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

ArcGIS.Desktop.Mapping Namespace > GraphicsLayerExtensions Class > AddElements Method : AddElements(GraphicsLayer,IEnumerable<CIMGraphic>,IEnumerable<IEnumerable<CIMStringMap>>) Method
The collection of graphics to be added
Custom properties or null
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

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.
The elements will not be selected after the add.
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

GraphicsLayerExtensions Class
GraphicsLayerExtensions Members
Overload List