ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / BasicFeatureLayer Class / SelectionCount Property
Example

In This Topic
    SelectionCount Property (BasicFeatureLayer)
    In This Topic
    Gets the number of features selected in the layer.
    Syntax
    Public ReadOnly Property SelectionCount As Integer
    public int SelectionCount {get;}
    Example
    Count the features selected on a layer
    {
        var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
        var noFeaturesSelected = lyr.SelectionCount;
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also