ArcGIS Pro 2.9 API Reference Guide
AddElements(GraphicsLayer,IEnumerable<CIMGraphic>,IEnumerable<IEnumerable<CIMStringMap>>,Boolean) Method

ArcGIS.Desktop.Mapping Namespace > GraphicsLayerExtensions Class > AddElements Method : AddElements(GraphicsLayer,IEnumerable<CIMGraphic>,IEnumerable<IEnumerable<CIMStringMap>>,Boolean) Method
The collection of graphics to be added
Custom properties or null
True to set the elements selected after the add
Add a collection of ArcGIS.Desktop.Layouts.GraphicElement based on the list of ArcGIS.Core.CIM.CIMGraphic. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

graphicsLayer
graphics
The collection of graphics to be added
customProperties
Custom properties or null
select
True to set the elements selected after the add

Return Value

Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
The value cannot be null: graphics
Map has reached maximum graphics count limit of 4000 elements. One or more elements cannot be created.
Map has reached maximum graphics size limit of 10 MB. One or more elements cannot be created.
Remarks
The map view displaying the graphics layer should be initialized.
o ArcGIS.Core.CIM.CIMInkGraphic is not supported
o ArcGIS.Core.CIM.CIMMultiPatchGraphic is not supported
Custom properties, if provided, must be serializable to string and must match the number of graphics.
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

GraphicsLayerExtensions Class
GraphicsLayerExtensions Members
Overload List