ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Layout Class / Elements Property
Example

In This Topic
    Elements Property (Layout)
    In This Topic
    Gets the collection of elements in a GroupElement.
    Syntax

    Property Value

    Type: ReadOnlyCollectionBase
    Example
    Find an element on a layout
    {
      //Find an element on a layout.
      //Note: Must be on QueuedTask.Run
      // Reference and load the layout associated with the layout item
      Layout mylayout = layoutItem.GetLayout();
      if (mylayout != null)
      {
        //Find a single specific element
        Element rect = mylayout.FindElement("Rectangle") as Element;
    
        //Or use the Elements collection
        Element rect2 = mylayout.Elements.FirstOrDefault(item => item.Name.Equals("Rectangle"));
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also