cjj1308
路人甲
路人甲
  • 注册日期2006-06-29
  • 发帖数28
  • QQ
  • 铜币201枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1757回复:2

[求助]AO 新建要素的完成事件

楼主#
更多 发布于:2008-07-31 16:59
新建了个属性窗体,需要在ArcMap中编辑图层时,添加完新要素后跳出这个窗体,但不知道 ,添加完新要素的响应事件,有高手知道怎么做么?
喜欢0 评分0
hover
路人甲
路人甲
  • 注册日期2005-12-13
  • 发帖数69
  • QQ
  • 铜币279枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2008-08-05 09:46
<P>见意你自己写一个ITool类,实现一下添加的功能和弹出窗口的功能就可以了。很简单。</P>
承接、合作各种GIS项目开发 :ArcGIS平(基于AO、AE、ArcIMS、ArcServer开发) :MapInfo平台(基于MapXtreme 2004/2005、MapXtreme For Java开发) E-Mail:cmcrj0929@163.com QQ:31814576 有国土、市政、交通、电力等行业的成功应用项目经验。
举报 回复(0) 喜欢(0)     评分
cjj1308
路人甲
路人甲
  • 注册日期2006-06-29
  • 发帖数28
  • QQ
  • 铜币201枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2008-08-11 09:40
<P>好象可以新建个编辑任务,用到IEditTask接口,在帮助里也找到个例子</P><PRE><PRE><CODE><PRE>/// <summary><BR><SUMMARY>/// This class implements the IEditTask interface.</PRE>/// The class is registered as a new EditTask and appears as Select Features Using Sketch
/// in the EditTask Menu.
/// The EditTasks performs a selection by line when the sketch is finished.
/// This Example also shows how to use the IEdit.getParent() method.
<CODE><PRE>/// </summary><BR></PRE></CODE>
</SUMMARY>public class Parent_Example : IEditTask
{
    #region IEditTask Members
    IEditor m_editor;
    IEditSketch m_editSketch;
    public void Activate(IEditor editor, IEditTask oldTask)
    {
        m_editor = editor;
        m_editSketch = m_editor as IEditSketch;
        //Set the geometry type of the edit sketch to polyline
        m_editSketch.GeometryType = esriGeometryType.esriGeometryPolyline;
    }
    public void Deactivate()
    {
        //nothing happens
    }
    public string Name
    {
        get
        {
            return "Select Features Using Sketch";
        }
    }
    public void OnDeleteSketch()
    {
        //nothing happens
    }
    public void OnFinishSketch()
    {
         //Get the selection environment
        IMxApplication arcMap = m_editor.Parent as IMxApplication;
        ISelectionEnvironment selectionEnvironment = arcMap.SelectionEnvironment;
        //Use IMap.SelectbyShape with the edit sketch geometry to do the selection
        IMap map = m_editor.Map;
        IActiveView activeView = map as  IActiveView;
        //get rid of old selection first
        activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);
        IGeometry editSketchGeometry = m_editSketch.Geometry;
        map.SelectByShape(editSketchGeometry, selectionEnvironment, false);
        //refresh with the new selection
        activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);
    }
    #endregion
    #region ArcGIS Component Category Registrar generated code<BR>    /// <summary><BR>    /// Required method for ArcGIS Component Category registration -<BR>    /// Do not modify the contents of this method with the code editor.<BR>    /// </summary><BR>    [ComRegisterFunction()]<BR>    private static void Reg(String regKey)<BR>    {<BR>        //EditTasks.Register(regKey);<BR>    }</CODE></PRE><PRE><CODE>    [ComUnregisterFunction()]<BR>    private static void Unreg(String regKey)<BR>    {<BR>        EditTasks.Unregister(regKey);<BR>    }<BR>    #endregion<BR>}</CODE></PRE><PRE><CODE></CODE> </PRE><PRE><CODE>但是不清楚怎么把这个类新建的编辑任务添加到ArcMap中</CODE></PRE></PRE>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部