ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / IElementFactory Interface / CreateMapSurroundElement Method
The parent element container
The map surround frame envelope or center point
Associated surround properties
An element name (optional)
Select after create flag (default is true) (optional)
Additional element properties (optional)

In This Topic
    CreateMapSurroundElement Method (IElementFactory)
    In This Topic
    Create a map surround element based on the geometry and associated map surround and element properties. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    elementContainer
    The parent element container
    frameOrLocation
    The map surround frame envelope or center point
    surroundInfo
    Associated surround properties
    elementName
    An element name (optional)
    select
    Select after create flag (default is true) (optional)
    elementInfo
    Additional element properties (optional)

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Empty or null geometry
    Value cannot be null: surroundInfo
    frameOrLocation must be a point or envelope
    elementContainer must be a layout or group element (on a layout)
    Remarks
    Graphic layers are not valid containers for surrounds. The frameOrLocation can be either a ArcGIS.Core.Geometry.MapPoint or ArcGIS.Core.Geometry.Envelope. A default extent will be calculated if a map point is provided (rather than an envelope).
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also