Select to view content in your preferred language

Geoprocessing pane doesn't launch from Add-In ribbon bar button

81
1
Wednesday
gh8reth
Emerging Contributor

I have built an Add-In to open a PYT toolbox dialog in ArcGIS Pro 3.4

There are two commands that I have identified to launch the toolbox.  The first is...

var gpResult = await Geoprocessing.OpenToolDialogAsync(scriptPath);

 Using this method, the button launches the PYT toolbox.  But while the geoprocessing pane is open, certain ArcGIS Pro functions (incl. shutting down the application) are disabled.

The second command is...

Geoprocessing.OpenToolDialog(scriptPath, null, null, newSubPane: false);

Using this method, the button only launches the PYT toolbox if the Geoprocessing pane is already open. However the limitations of the first method are avoided. 

Any ideas of how to fix either method?

In the meantime I am using the following code:

var pane = FrameworkApplication.DockPaneManager.Find("esri_geoprocessing_toolBoxes");
if (pane == null){MessageBox.Show("Geoprocessing Pane must be open to run tool");
return;}

 I have tried to insert code to launch the Geoprocessing pane, without any success. Again any ideas please?

0 Kudos
1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

Try to change newSubpane parameter value to true:

Geoprocessing.OpenToolDialog(scriptPath, null, null, newSubPane: true);
0 Kudos