ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework Namespace / FrameworkApplication Class / SetCurrentToolAsync Method
The tool's DAML identifier.
Example

In This Topic
    SetCurrentToolAsync Method
    In This Topic
    Activates the specified tool.
    Syntax
    public static Task SetCurrentToolAsync( 
       string id
    )
    Public Shared Function SetCurrentToolAsync( _
       ByVal id As String _
    ) As Task

    Parameters

    id
    The tool's DAML identifier.

    Return Value

    Returns an awaitable task which, when complete, indicates the tool is fully initialized and ready for use.
    Remarks
    Setting the application's current tool is asynchronous as tools often need to initialize themselves on the primary worker thread before they are ready for use.
    Example
    Set the current tool
    // use SetCurrentToolAsync
    FrameworkApplication.SetCurrentToolAsync("esri_mapping_selectByRectangleTool");
    
    // or use ICommand.Execute
    ICommand cmd = FrameworkApplication.GetPlugInWrapper("esri_mapping_selectByRectangleTool") as ICommand;
    if ((cmd != null) && cmd.CanExecute(null))
      cmd.Execute(null);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also