public SelectionSet GetSelection()
Public Function GetSelection() As SelectionSet
Return Value
The selection in the map represented by the collection of layers and tables and their corresponding object ids.
public SelectionSet GetSelection()
Public Function GetSelection() As SelectionSet
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
{
// get map selection
var mapSelSet = MapView.Active.Map.GetSelection();
// create a selectionSet
var selDict = new Dictionary<MapMember, List<long>>();
selDict.Add(featureLayer, new List<long> { 1506, 2696, 2246, 1647, 948 });
var layerSelSet = ArcGIS.Desktop.Mapping.SelectionSet.FromDictionary(selDict);
// test for equality - use Equals method
var isEquals = mapSelSet.Equals(layerSelSet);
// test for equality - use operators
var equals = mapSelSet == layerSelSet;
var notEquals = mapSelSet != layerSelSet;
}
{
await QueuedTask.Run(() =>
{
//Get the selected features from the map and filter out the standalone table selection.
var selectedFeatures = mapView.Map.GetSelection();
//Flash the collection of features.
mapView.FlashFeature(selectedFeatures);
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)