ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GraphicsLayer Class
Members Example

In This Topic
    GraphicsLayer Class
    In This Topic
    Graphics layers are layers that act as containers for graphics elements that can be added to a map.
    Object Model
    GraphicsLayer ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassSpatialReference ClassTimeParameters ClassMap ClassILayerContainer InterfaceEnvelope Class
    Syntax
    Example
    Accessing GraphicsLayer
    //get the first graphics layer in the map's collection of graphics layers
    var graphicsLayer = map.GetLayersAsFlattenedList().OfType<ArcGIS.Desktop.Mapping.GraphicsLayer>().FirstOrDefault();
    if (graphicsLayer != null)
    {
      //TODO...use the graphics layer      
    }
    Remove Graphic elements
    //on the QueuedTask      
    graphicsLayer.RemoveElements(graphicsLayer.GetSelectedElements());
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Mapping.MapMember
             ArcGIS.Desktop.Mapping.Layer
                ArcGIS.Desktop.Mapping.GraphicsLayer

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also