Launch toolbox script from .NET add-in?

604
1
Jump to solution
05-22-2014 09:02 AM
EvanBlaisdell
New Contributor III
Hello,

Is it possible to use a button on a form in an add-in to launch a custom geoprocessing script (contained in a custom toolbox) such that the window pops up asking for parameters?  I want the window to appear just as if you are clicking on the script directly in the ArcToolbox window, so that you can choose parameters on that window and click OK to run the script.

Thanks,
Evan.
0 Kudos
1 Solution

Accepted Solutions
EvanBlaisdell
New Contributor III
Hello,

Is it possible to use a button on a form in an add-in to launch a custom geoprocessing script (contained in a custom toolbox) such that the window pops up asking for parameters?  I want the window to appear just as if you are clicking on the script directly in the ArcToolbox window, so that you can choose parameters on that window and click OK to run the script.

Thanks,
Evan.


Well that was easy after all:

 IGPToolCommandHelper cmdHelper = new GPToolCommandHelperClass(); cmdHelper.SetToolByName("MyToolbox.tbx", "MyToolName"); cmdHelper.Invoke(null); 


...and you need to reference ESRI.ArcGIS.GeoprocessingUI.

View solution in original post

0 Kudos
1 Reply
EvanBlaisdell
New Contributor III
Hello,

Is it possible to use a button on a form in an add-in to launch a custom geoprocessing script (contained in a custom toolbox) such that the window pops up asking for parameters?  I want the window to appear just as if you are clicking on the script directly in the ArcToolbox window, so that you can choose parameters on that window and click OK to run the script.

Thanks,
Evan.


Well that was easy after all:

 IGPToolCommandHelper cmdHelper = new GPToolCommandHelperClass(); cmdHelper.SetToolByName("MyToolbox.tbx", "MyToolName"); cmdHelper.Invoke(null); 


...and you need to reference ESRI.ArcGIS.GeoprocessingUI.
0 Kudos