Supported with:
Additional library information: Contents, Object Model Diagram
See the following sections for more information about this namespace:
- ArcGIS for Desktop Basic
- ArcGIS for Desktop Standard
- ArcGIS for Desktop Advanced
Additional library information: Contents, Object Model Diagram
The GeoprocessingUI library provides user interfaces (UIs) to support objects contained in the Geoprocessing library. The library supports these useful objects for a developer: ArcToolboxExtension, ArcToolbox, and GPToolCommandHelper.
It is not common for developers to extend this library.
See the following sections for more information about this namespace:
ArcToolBoxExtension
The ArcToolboxExtension coclass is used when working with ArcToolbox in an application such as ArcCatalog, ArcMap, or ArcGlobe. From ArcToolboxExtension, you can access the current toolboxes in ArcToolbox.
To get a reference to ArcToolboxExtension, use IApplication.FindExtensionbyCLSID or IApplication.FindExtensionByName.
The following code example shows the former method being used to acquire a reference of type IArcToolboxExtension to the ArcToolboxExtension object:
[VB.NET]
Sub GetArcToolboxExtension(byVal application As IApplication)
Dim uID As UID = New UIDClass
UID.Value = "esriGeoprocessingUI.ArcToolboxExtension"
Dim arcToolboxExtension As IArcToolboxExtension
arcToolboxExtension = application.FindExtensionByCLSID(UID)
End Sub
[C#]
Sub GetArcToolboxExtension(IApplication application)
{
UID uID = new UIDClass();
uID.Value = "esriGeoprocessingUI.ArcToolboxExtension";
IArcToolboxExtension arcToolboxExtension;
arcToolboxExtension = application.FindExtensionByCLSID(uID);
}
End Sub
ArcToolbox
The ArcToolbox object manages the set of toolboxes and tools displayed in the ArcToolbox dockable window. This dockable window can be displayed or hidden in the application (ArcCatalog, ArcMap, or ArcGlobe). This object provides utility methods for adding and removing toolboxes from the ArcToolbox window, invoking a dialog box for a geoprocessing tool, and so forth.
The following code example shows the process for obtaining ArcToolbox and getting a geoprocessing tool by name:
[VB.NET]
Sub GetArcToolbox(byVal application As IApplication)
Dim uID As UID = New UIDClass
uID.Value = "esriGeoprocessingUI.ArcToolboxExtension"
Dim arcToolboxExtension As IArcToolboxExtension
arcToolboxExtension = application.FindExtensionByCLSID(uID)
Dim arcToolbox As IArcToolbox
arcToolbox = arcToolboxExtension.ArcToolbox
Dim gpTool As IGPTool
gpTool = pArcToolbox.GetToolbyNameString("buffer_analysis")
End Sub
[C#]
public void GetArcToolbox(IApplication application)
{
UID uID = new UIDClass();
uID.Value = "esriGeoprocessingUI.ArcToolboxExtension";
IArcToolboxExtension arcToolboxExtension;
arcToolboxExtension = application.FindExtensionByCLSID(uID);
IArcToolbox arcToolbox;
arcToolbox = arcToolboxExtension.ArcToolbox;
IGPTool gpTool;
gpTool = pArcToolbox.GetToolbyNameString("buffer_analysis");
}
GPToolCommandHelper
GPToolCommandHelper is a utility/helper object that allows you to easily invoke a dialog box for a specific geoprocessing tool from a toolbar or context menu.
The following code example shows how to invoke a geoprocessing tool from a button on a toolbar:
[VB.NET]
Private Sub UIButtonControl1_Click(byVal application As IApplication)
Dim uID As UID = New UIDClass
uID = "esriGeoprocessingUI.ArcToolboxExtension"
Dim arcToolboxExtension As IArcToolboxExtension
arcToolboxExtension = application.FindExtensionByCLSID(pUID)
Dim arcToolbox As IArcToolbox
arcToolbox = arcToolboxExtension.ArcToolbox
Dim gpTool As IGPTool
gpTool = arcToolbox.GetToolbyNameString("buffer_analysis")
Dim gpCommandHelper As IGPToolCommandHelper = New GPToolCommandHelper
gpCommandHelper.SetTool = gpTool
gpCommandHelper.Invoke = Nothing
End Sub
[C#]
private void UIButtoControl1_Click(IApplication application)
{
UID uID = new UIDClass();
uID = "esriGeoprocessingUI.ArcToolboxExtension";
IArcToolboxExtension arcToolboxExtension;
arcToolboxExtension = application.FindExtensionByCLSID(uID);
IArcToolbox arcToolbox;
arcToolbox = arcToolboxExtension.ArcToolbox;
IGPTool gpTool;
gpTool = arcToolbox.GetToolbyNameString("buffer_analysis");
IGPToolCommandHelper gpCommandHelper = new GPToolCommandHelper();
gpCommandHelper.SetTool(gpTool);
gpCommandHelper.Invoke(null);
}