ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GraphicsLayerExtensions Class / GetElements Method
The graphics layer being extended

In This Topic
    GetElements Method (GraphicsLayerExtensions)
    In This Topic
    Get the collection of elements from the GraphicsLayer. Nesting within ArcGIS.Desktop.Layouts.GroupElementis preserved.
    Syntax
    public static IReadOnlyList<Element> GetElements( 
       GraphicsLayer graphicsLayer
    )
    Public Shared Function GetElements( _
       ByVal graphicsLayer As GraphicsLayer _
    ) As IReadOnlyList(Of Element)

    Parameters

    graphicsLayer
    The graphics layer being extended

    Return Value

    Remarks
    Use GetElementsAsFlattenedList to flatten the collection otherwise enumerate any returned ArcGIS.Desktop.Layouts.GroupElement individually.
    Elements are returned in Z order. The 0th Element is at the back or 'bottom' and the 'Nth' element is at the front or 'top'.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also