ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing.Templates Namespace / EditingTemplate Class / ActivateLastSelectedToolAsync() Method
Example

In This Topic
    ActivateLastSelectedToolAsync() Method
    In This Topic
    Activates the Tool that is identified by LastSelectedToolID.
    Syntax
    Public Function ActivateLastSelectedToolAsync() As Task
    public Task ActivateLastSelectedToolAsync()
    Example
    Activate template and its last selected tool
    {
      await QueuedTask.Run(() =>
      {
        // Get all templates for the layer
        var templates = featureLayer.GetTemplates();
        if (templates.Count == 0)
          return;
        // Get the first template - alternatively get a specific template
        var template = templates.First();
    
        // Activate the last selected/used tool for the template
        template.ActivateLastSelectedToolAsync();
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also