arcgis engine delete element
时间: 2023-06-28 19:05:07 浏览: 39
To delete an element in ArcGIS Engine, you can use the IGraphicsContainer.DeleteElement method. Here is an example code snippet:
```
// Get the graphics container
IGraphicsContainer graphicsContainer = axMapControl1.Map as IGraphicsContainer;
// Get the element to delete (e.g., the first element in the container)
IElement element = graphicsContainer.get_Element(0);
// Delete the element
graphicsContainer.DeleteElement(element);
// Refresh the display
axMapControl1.Refresh(esriViewDrawPhase.esriViewGraphics, null, null);
```
In this example, we first get the graphics container from the map control. Then, we get the element to delete (in this case, the first element in the container). Finally, we delete the element and refresh the display. You can modify this code to delete a specific element based on your requirement.