ArcGIS Pro 2.7 API Reference Guide
GroupElements Method (GraphicsLayerExtensions)

ArcGIS.Desktop.Mapping Namespace > GraphicsLayerExtensions Class : GroupElements Method
The elements to be grouped.
Group the collection of elements. This method must be called on the MCT. Use QueuedTask.Run
Syntax
Public Shared Function GroupElements( _
   ByVal graphicsLayer As GraphicsLayer, _
   ByVal elements As IEnumerable(Of Element) _
) As GroupElement

Parameters

graphicsLayer
elements
The elements to be grouped.

Return Value

ArcGIS.Desktop.Layouts.GroupElement containing the grouped elements
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
elements cannot be null or empty
elements must belong to graphicsLayer
elements must be group elements or graphic elements
element parents must be the same and non-null
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
All group elements in the input collection must have the same parent.
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

GraphicsLayerExtensions Class
GraphicsLayerExtensions Members