ArcGIS Pro 3.4 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 Version

OpenToolDialog Method
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 miltiple times if user re-run the same tool
  • OnEndExecute - param type IGPResult. Can be sent miltiple 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
Geoprocessing Open ToolDialog
string input_points = @"C:\data\ca_ozone.gdb\ozone_points";
string output_polys = @"C:\data\ca_ozone.gdb\ozone_buff";
string buffer_dist = "2000 Meters";

var param_values = Geoprocessing.MakeValueArray(input_points, output_polys, buffer_dist);

Geoprocessing.OpenToolDialog("analysis.Buffer", param_values);
Open a script tool dialog in Geoprocessing pane
string input_data = @"C:\data\data.gdb\Population";
string out_pdf = @"C:\temp\Reports.pdf";
string field_name = "INCOME";
// 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;

var val_array = await QueuedTask.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 };
  return Geoprocessing.MakeValueArray(new object[] { geom, null, @"1000 Meters" });

});
//Call OpenToolDialog on the UI thread!
Geoprocessing.OpenToolDialog(tool_name, val_array, null, false);
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also