ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / SetSelection Method
The SelectionSet used to set the map selection.
Combination method used in the selection operation.
Example

In This Topic
    SetSelection Method (Map)
    In This Topic
    Set the selection in the map. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    selectionSet
    The SelectionSet used to set the map selection.
    method
    Combination method used in the selection operation.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    The selection created in the map.
    Example
    Clear all selection in an Active map
    QueuedTask.Run(() =>
    {
      if (MapView.Active.Map != null)
      {
        MapView.Active.Map.SetSelection(null);
      }
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also