AnsweredAssumed Answered

Check if toolbox tool exists before opening it

Question asked by mapvis01 on Aug 17, 2019
Latest reply on Aug 18, 2019 by mapvis01

Is there a way to check if a toolbox tool exists before opening it using the arcgis pro sdk? When I tried OpenToolDialog()  on a tool not in the toolbox it tried to open it and failed.  

 

 

string analysisToolName = "C:\\Program Files\\ArcGIS\\Pro\\Resources\\ArcToolBox\\Toolboxes\\Analysis Tools.tbx\\NewToolBuffer";

var param_values = Geoprocessing.MakeValueArray();
param_values = null;
if (File.Exists(analysisToolName))
{
   Debug.WriteLine("FOUND");
   Geoprocessing.OpenToolDialog(analysisToolName, param_values);
}
else
{
   Debug.WriteLine("DID NOT FIND TOOL");
}

Outcomes