Activate Geoprocessing pane and open the tool dialog in the pane.
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);
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.