ArcGIS Pro 2.6 API Reference Guide
SelectElements(MapView,GraphicsLayer,Geometry,SelectionCombinationMethod,Boolean) Method

ArcGIS.Desktop.Mapping Namespace > MappingExtensions Class > SelectElements Method : SelectElements(MapView,GraphicsLayer,Geometry,SelectionCombinationMethod,Boolean) Method
The graphicsLayer whose elements will be selected
The selection geometry
Combination method used in selection operation
This parameter only applies to 2D. Indicates whether only features that are completely within the geometry should be selected.
Select elements on a graphics layer that visually intersect a geometry. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
Public Overloads Shared Function SelectElements( _
   ByVal mapView As MapView, _
   ByVal graphicsLayer As GraphicsLayer, _
   ByVal geometry As Geometry, _
   Optional ByVal method As SelectionCombinationMethod, _
   Optional ByVal isWhollyWithin As Boolean _
) As IReadOnlyList(Of Element)

Parameters

mapView
graphicsLayer
The graphicsLayer whose elements will be selected
geometry
The selection geometry
method
Combination method used in selection operation
isWhollyWithin
This parameter only applies to 2D. Indicates whether only features that are completely within the geometry should be selected.

Return Value

Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
geometry cannot be null or empty
graphics layer is not associated with this view
Remarks
Currently, graphics layers are only supported for 2D.
Selection against elements always uses visual intersection as opposed to geometric intersection (of the search geometry with the element geometry). The graphics layer must be visible and selectable.
Use SelectElements(MapView,Geometry,SelectionCombinationMethod,Boolean) to select against all visible graphics layers.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

MappingExtensions Class
MappingExtensions Members
Overload List