ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / Element Class
Members Example

In This Topic
    Element Class
    In This Topic
    Represents an abstract page layout element.
    Object Model
    Element ClassCoordinate2D StructureEnvelope ClassCIMElement ClassGeometry ClassIElementContainer Interface
    Syntax
    Remarks
    There are many types of elements. This class exposes members that are common to all layout elements.
    Example
    Create_Group_With_Single_Element_Root
    //Create a group with a single element at the root level of the contents pane.
    
    //Find an existing element
    Element titleElm = layout.FindElement("Title") as Element;
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //At 2.x - GroupElement groupWithSingleElementAtRoot = LayoutElementFactory.Instance.CreateGroupElement(layout, titleElm);
      //         groupWithSingleElementAtRoot.SetName("Group with single element at root"); 
      GroupElement groupWithSingleElementAtRoot = 
               ElementFactory.Instance.CreateGroupElement(layout, new List<Element>() { titleElm }, "Group with single element at root");
    });
    Create_Group_With_List_Elements_Root
    //Create a group with a list of elements at the root level of the contents pane.
    
    //Find an existing elements
    Element scaleBar = layout.FindElement("Scale Bar") as Element;
    Element northArrow = layout.FindElement("North Arrow") as Element;
    Element legend = layout.FindElement("Legend") as Element;
    
    //Build a list and add the elements
    List<Element> elmList = new List<Element>
    {
      scaleBar,
      northArrow,
      legend
    };
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //At 2.x - GroupElement groupWithListOfElementsAtRoot = LayoutElementFactory.Instance.CreateGroupElement(layout, elmList);
      //         groupWithListOfElementsAtRoot.SetName("Group with list of elements at root");
      GroupElement groupWithListOfElementsAtRoot = 
        ElementFactory.Instance.CreateGroupElement(layout, elmList, "Group with list of elements at root");
    });
    Inheritance Hierarchy
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also