ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core.Geoprocessing Namespace / Geoprocessing Class / OpenToolDialog Method
Use toolboxalias.toolname or toolname_toolboxalias for system tools, a path to a custom tool in a toolbox like @"C:\CustomTools\Toolbox.atbx\MyTool", or a relative path to a tool in a project toolbox like @"ProjectToolbox.atbx\MyTool"
Array of parameter values
Array of environment settings (name,value)
Add ToolDialog as new sub-pane
callback events are:
Example

In This Topic
    OpenToolDialog Method
    In This Topic
    Activate Geoprocessing pane and open the tool dialog in the pane.
    Syntax

    Parameters

    toolPath
    Use toolboxalias.toolname or toolname_toolboxalias for system tools, a path to a custom tool in a toolbox like @"C:\CustomTools\Toolbox.atbx\MyTool", or a relative path to a tool in a project toolbox like @"ProjectToolbox.atbx\MyTool"
    values
    Array of parameter values
    environments
    Array of environment settings (name,value)
    newSubPane
    Add ToolDialog as new sub-pane
    callback
    callback events are:
    • OnBeginExecute - param = null. Can be sent multiple times if user re-run the same tool
    • OnEndExecute - param type IGPResult. Can be sent multiple times if user re-run the same tool
    • OnClose - param = null, send when user click back or open new tool in the same sub-pane
    Example
    Open a script tool dialog in Geoprocessing pane
    {
      // use defaults for other parameters - no need to pass any value
      var arguments = Geoprocessing.MakeValueArray(input_data, out_pdf, field_name);
    
      string toolpath = @"C:\data\WorkflowTools.tbx\MakeHistogram";
    
      Geoprocessing.OpenToolDialog(toolpath, arguments);
    }
    Open the Geoprocessing Tool Pane for a specific Tool
    {
      // For a System toolbox, to identify the specific tool to show, use
      // either:
      // o "ToolboxName.ToolName" - eg "analysis.Buffer"
      // o "Fullpath to Toolbox.tbx\Toolname" - eg:
      //       "C:\ArcGIS\Resources\ArcToolBox\Toolboxes\Analysis Tools.tbx\Buffer"
      // note:
      // For legacy purposes, the convention "ToolName_ToolBox" is also supported so,
      // o "Buffer_analysis" would also work
      //
      // For a custom toolbox, the full path must be provided. So, for example,
      // given the custom toolbox "DeepThought.tbx" containing a python script tool
      // called "Answer", installed at "C:\Data\DeepThought-ProAddin\Toolboxes\toolboxes",
      // the full path would be:
      // o "C:\Data\DeepThought-ProAddin\Toolboxes\toolboxes\DeepThought.tbx\Answer"
    
      //Open the Buffer Tool GP Dialog - use either the full path or just 
      //use "ToolboxName.ToolName"
      var path = @"C:\ArcGIS\Resources\ArcToolBox\Toolboxes\Analysis Tools.tbx";
      var full_tool_name = System.IO.Path.Combine(path, "Buffer");
    
      var short_tool_name = "analysis.Buffer";
    
      var tool_name = short_tool_name;//or full_tool_name
    
      var extent = MapView.Active.Extent;
      IReadOnlyList<string> val_array = null;
    
      // Note: Needs QueuedTask to run
      {
        var rect = GeometryEngine.Instance.Scale(extent, extent.Center, 0.25, 0.25) as Envelope;
        var poly = PolygonBuilderEx.CreatePolygon(rect, rect.SpatialReference);
        var geom = new List<object>() { poly };
    
        val_array = Geoprocessing.MakeValueArray(geom, null, @"1000 Meters");
      }
      //Call OpenToolDialog on the UI thread!
      Geoprocessing.OpenToolDialog(tool_name, val_array, null, false);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also