ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / ElementFactory Class / CreateElement Method
Layout or GroupElement
The cimElement to be created
Select after create flag (default is true) (optional)

In This Topic
    CreateElement Method (ElementFactory)
    In This Topic
    Creates an element using the corresponding ArcGIS.Core.CIM.CIMElement definition. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function CreateElement( _
       ByVal elementContainer As IElementContainer, _
       ByVal cimElement As CIMElement, _
       Optional ByVal select As Boolean _
    ) As Element

    Parameters

    elementContainer
    Layout or GroupElement
    cimElement
    The cimElement to be created
    select
    Select after create flag (default is true) (optional)

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Value cannot be null: cimElement
    Use ElementFactory.CreateGroupElement(...) to create a group element.
    Remarks
    cimElement cannot be of type ArcGIS.Core.CIM.CIMGroupElement or a NotSupportedException will be thrown. Use CreateGroupElement
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also