Supported with:
Additional library information: Contents, Object Model Diagram
See the following sections for more information about this namespace:
[VB.NET]
[VB.NET]
[VB.NET]
- ArcView
- ArcEditor
- ArcInfo
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.
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 (i.e., ArcCatalog, ArcMap, or ArcGlobe). This object provides utility methods for adding and removing toolboxes from the ArcToolbox window, invoking a dialog for a geoprocessing tool, and so forth.
The following code example shows obtaining ArcToolbox and getting a geoprocessing tool by name.
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 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.
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);
}