ArcGIS Pro 2.9 API Reference Guide
CreateGraphicElement(GraphicElementContainer,Geometry,CIMSymbol,String) Method

ArcGIS.Desktop.Layouts Namespace > IElementFactory Interface > CreateGraphicElement Method : CreateGraphicElement(GraphicElementContainer,Geometry,CIMSymbol,String) Method
The graphic element container
The geometry to be used for the graphic element
The symbol to be used for the graphic element. Can be null
An element name (optional)
Create a GraphicElement based on the input geometry and symbol (optional). This method must be called on the MCT. Use QueuedTask.Run.
Syntax
Overloads Function CreateGraphicElement( _
   ByVal elementContainer As GraphicElementContainer, _
   ByVal geometry As Geometry, _
   Optional ByVal symbol As CIMSymbol, _
   Optional ByVal elementName As String _
) As GraphicElement

Parameters

elementContainer
The graphic element container
geometry
The geometry to be used for the graphic element
symbol
The symbol to be used for the graphic element. Can be null
elementName
An element name (optional)

Return Value

Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
geometry cannot be null or empty
symbol is not a CIMPointSymbol | CIMLineSymbol | CIMPolygonSymbol
Remarks
Multipatch geometry is not currently supported.
The geometry cannot be empty or null. Providing the wrong symbol type for the given geometry will result in an System.ArgumentException. If symbol is null a default symbol of the correct type will be assigned.
Use LayoutElementFactory for additional creation options of page layout elements
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

IElementFactory Interface
IElementFactory Members
Overload List