ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SelectionMethod Enumeration
Example Example

In This Topic
    SelectionMethod Enumeration
    In This Topic
    Defines the spatial relations used to select features.
    Syntax
    Members
    MemberDescription
    Contains Query geometry contains the target geometry.
    Intersects Query geometry intersects the target geometry.
    Example
    Get/Set Selection Options
    var options = ApplicationOptions.SelectionOptions;
    
    QueuedTask.Run(() =>
    {
      var defaultColor = options.DefaultSelectionColor;
    
      var color = options.SelectionColor as CIMRGBColor;
      options.SetSelectionColor(ColorFactory.Instance.CreateRGBColor(255, 0, 0));
    
    
      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);
    
      var showSelectionChip = options.ShowSelectionChip;
      options.SetShowSelectionChip(!showSelectionChip);
    
      var showSelectionGraphic = options.ShowSelectionGraphic;
      options.SetShowSelectionGraphic(!showSelectionGraphic);
    
      var saveSelection = options.SaveSelection;
      options.SetSaveSelection(!saveSelection);
    
      var defaultTol = options.DefaultSelectionTolerance;
      var tol = options.SelectionTolerance;
      options.SetSelectionTolerance(2 * defaultTol);
    
      // extension methods available 
      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);
    });
    Get/Set Selection Options
    var options = ApplicationOptions.SelectionOptions;
    
    QueuedTask.Run(() =>
    {
      var defaultColor = options.DefaultSelectionColor;
    
      var color = options.SelectionColor as CIMRGBColor;
      options.SetSelectionColor(ColorFactory.Instance.CreateRGBColor(255, 0, 0));
    
    
      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);
    
      var showSelectionChip = options.ShowSelectionChip;
      options.SetShowSelectionChip(!showSelectionChip);
    
      var showSelectionGraphic = options.ShowSelectionGraphic;
      options.SetShowSelectionGraphic(!showSelectionGraphic);
    
      var saveSelection = options.SaveSelection;
      options.SetSaveSelection(!saveSelection);
    
      var defaultTol = options.DefaultSelectionTolerance;
      var tol = options.SelectionTolerance;
      options.SetSelectionTolerance(2 * defaultTol);
    
      // extension methods available 
      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
       System.ValueType
          System.Enum
             ArcGIS.Desktop.Mapping.SelectionMethod

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also