ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapTool Class / UseSelection Property

In This Topic
    UseSelection Property
    In This Topic
    Gets or sets if the sketch needs a selection in order to operate. This requirement allows the tool to have two different modes; the normal sketch mode and an additional selection mode.The user is able to toggle the tool between sketch and select modes by pressing and holding down the SHIFT key. When this occurs the sketch is suspended and the user can select additional features. Releasing the SHIFT key puts the tool back into sketch mode, restores the previous state of the sketch (and the sketch undo / redo stack) and allows you to resume sketching.

    The default value is false.
    Syntax
    protected bool UseSelection {get; set;}
    Protected Property UseSelection As Boolean
    Remarks
    Your SketchType must be SketchGeometryType.Point, SketchGeometryType.Multipoint, SketchGeometryType.Line or SketchGeometryType.Polygon in order to be able to toggle between sketch and sketch selection modes. No other SketchTypes support this behavior.

    When this property is set to true, the user can toggle between sketch and selection mode by holding the SHIFT key. The sketch state is saved while the SHIFT key is down and selections are made. The sketch is resumed when the SHIFT key is released.

    If this property is set to false, the MapTool does not recognize the SHIFT key as having this special behavior.

    Note that toggling between selection and sketch modes can also be achieved with the ActivateSelectAsync method. If using this method, the sketch state will only be saved if UseSelection is True.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also