ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / IElementFactory Interface / CreatePredefinedShapeGraphicElement Method / CreatePredefinedShapeGraphicElement(IElementContainer,PredefinedShape,MapPoint,Double,Double,CIMPolygonSymbol,String,Boolean,ElementInfo) Method
The parent element container
The shape type of the graphic
The location of the graphic
The width of the graphic bounding box (optional)
The height of the graphic bounding box (optional)
The symbol to be used with the graphic (optional)
An element name (optional)
Select after create flag (default is true) (optional)
Additional element properties (optional)

In This Topic
    CreatePredefinedShapeGraphicElement(IElementContainer,PredefinedShape,MapPoint,Double,Double,CIMPolygonSymbol,String,Boolean,ElementInfo) Method
    In This Topic
    Create a polygon graphic of the specified PredefinedShape using the provided location, optional size dimensions, and symbol.
    Syntax
    Overloads Function CreatePredefinedShapeGraphicElement( _
       ByVal elementContainer As IElementContainer, _
       ByVal shapeType As PredefinedShape, _
       ByVal location As MapPoint, _
       Optional ByVal width As Double, _
       Optional ByVal height As Double, _
       Optional ByVal polySymbol As CIMPolygonSymbol, _
       Optional ByVal elementName As String, _
       Optional ByVal select As Boolean, _
       Optional ByVal elementInfo As ElementInfo _
    ) As GraphicElement

    Parameters

    elementContainer
    The parent element container
    shapeType
    The shape type of the graphic
    location
    The location of the graphic
    width
    The width of the graphic bounding box (optional)
    height
    The height of the graphic bounding box (optional)
    polySymbol
    The symbol to be used with the graphic (optional)
    elementName
    An element name (optional)
    select
    Select after create flag (default is true) (optional)
    elementInfo
    Additional element properties (optional)

    Return Value

    Remarks
    If neither a width or height is provided, the dimensions of the graphic bounding box will use a predefined system default. If only one of width or height is provided then the dimensions will be assumed to be equal. Negative width and height values will be treated the same as if they were missing. When generating a circle (i.e. PredefinedShape.Circle) width is used as the circle diameter. When generating an ellipse (i.e. PredefinedShape.Ellipse) width and height are assumed to be the length of the two axis - major/minor depending on which dimension is the longest.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also