/// <summary> /// 移除节点,标注和轨迹线Element /// </summary> void RemoveElements() { try { //刷新一次 m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, m_hookHelper.ActiveView.Extent); IGraphicsContainer g = m_hookHelper.ActiveView.GraphicsContainer; #region 1-new //RemoveElementFromGroupElement(m_Elements); #endregion #region 2 m_LabelElement.ClearElements(); m_VertexElement.ClearElements(); m_TraceElement.ClearElements(); #endregion } catch { } finally { //刷新一次 m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, m_hookHelper.ActiveView.Extent); } }
public static void RemoveGroupElement(IGroupElement igroupElement_0, ISceneGraph isceneGraph_0) { if (igroupElement_0.ElementCount > 0) { igroupElement_0.ClearElements(); IGraphicsContainer3D graphicsContainer3D = isceneGraph_0.Scene.BasicGraphicsLayer as IGraphicsContainer3D; graphicsContainer3D.DeleteElement(igroupElement_0 as IElement); } }