ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMBasicFeatureLayer Class / UseSelectionSymbol Property
Example

In This Topic
    UseSelectionSymbol Property (CIMBasicFeatureLayer)
    In This Topic
    Gets or sets a value indicating whether to use the selection symbol.
    Syntax
    public bool UseSelectionSymbol {get; set;}
    Public Property UseSelectionSymbol As Boolean
    Example
    Change the layer selection color
    var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      // get the CIM definition of the layer
      var layerDef = featureLayer.GetDefinition() as ArcGIS.Core.CIM.CIMBasicFeatureLayer;
      // disable the default symbol
      layerDef.UseSelectionSymbol = false;
      // assign a new color
      layerDef.SelectionColor = ColorFactory.Instance.RedRGB;
      // apply the definition to the layer
      featureLayer.SetDefinition(layerDef);
    
      if (!featureLayer.IsVisible)
        featureLayer.SetVisibility(true);
      //Do a selection
    
      MapView.Active.SelectFeatures(MapView.Active.Extent);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also