ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / SelectionOptions Class
Members Example

In This Topic
    SelectionOptions Class
    In This Topic
    Gets and sets the application selection options.
    Object Model
    SelectionOptions ClassCIMColor ClassCIMColor ClassCIMColor ClassCIMColor Class
    Syntax
    Public Class SelectionOptions 
    public class SelectionOptions 
    Example
    Get/Set Selection Options
    {
        var options = ApplicationOptions.SelectionOptions;
        //Note: Run within a QueuedTask
        var defaultColor = options.DefaultSelectionColor;
        //Set the selection color to red
        var color = options.SelectionColor as CIMRGBColor;
        options.SetSelectionColor(ColorFactory.Instance.CreateRGBColor(255, 0, 0));
    
        //Set the selection fill color and fill hatch
        var defaultFill = options.DefaultSelectionFillColor;
        var fill = options.SelectionFillColor;
        var isHatched = options.IsSelectionFillHatched;
        options.SetSelectionFillColor(ColorFactory.Instance.CreateRGBColor(100, 100, 0));
        if (!isHatched)
            options.SetSelectionFillIsHatched(true);
        //Toggle the selection Chip and Graphic
        var showSelectionChip = options.ShowSelectionChip;
        options.SetShowSelectionChip(!showSelectionChip);
    
        var showSelectionGraphic = options.ShowSelectionGraphic;
        options.SetShowSelectionGraphic(!showSelectionGraphic);
    
        //Get the value indicating whether to save the layer and standalone table selection with the map.
        var saveSelection = options.SaveSelection;
        options.SetSaveSelection(!saveSelection);
        //Get/Set the selection tolerance
        var defaultTol = options.DefaultSelectionTolerance;
        var tol = options.SelectionTolerance;
        options.SetSelectionTolerance(2 * defaultTol);
    
        // extension methods available for selection methods and combination methods
        var selMethod = options.SelectionMethod;
        options.SetSelectionMethod(SelectionMethod.Contains);
    
        var combMethod = options.CombinationMethod;
        options.SetCombinationMethod(SelectionCombinationMethod.Add);
    
        // note that the following SelectionCombinationMethod is not supported
        //options.SetCombinationMethod(SelectionCombinationMethod.XOR);
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Core.SelectionOptions

    Requirements

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

    ArcGIS Pro version: 3.4 or higher.
    See Also