【转载】Arcengine IElement 的节点编辑

原文地址 : http://blog.csdn.net/wangtao510/article/details/52789440

 

IElement的编辑用到两个关键接口:IElementEditVertices,ISelectTracker;

 

首先你得自定义一个 Tool;

 

在Tool 的 onClick() 中填写代码:

1.首先用IGraphicsContainerSelect 判断是否值选择单个Element,并获取此Element;

2. IElementEditVertices pEleVer=selectEle as IElementEditVertices ;

   pEleVer.MovingVertices=true;  //关键代码

   ISelectTracker pSelectTrc=pEleVer.GetMoveVertivesSelectionTrancker();

   设置:pSelectTrc.Display=m_hookHelper.ActiveView.Display;

              pSelectTrc.Draw() ;//绘制编辑框

 

在Tool的OnMouseDown() 中写:

    pSelectTrc.onMouseDown();

   onMouseMove,OnMouseUp以此类推;

 

注:在OnMouseUp 中重新指定selectEle .Getmetry=pSelectTrc.Geometry;

    在OnMouseMove中可根据pSelectTrc.QueryCursor获取鼠标句柄,设置鼠标样式

 

关于刷新问题,我的处理方法是先UnSelectElement,在LocateElementByEnvelope;

 

最后你就可以使用这个自定义的Tool来编辑Element节点了!

posted on 2017-07-06 20:56  jobgeo  阅读(827)  评论(0编辑  收藏  举报

导航