

Public NotInheritable Class GeoprocessingProjectItem Inherits ArcGIS.Desktop.Internal.Catalog.ItemInfo Implements ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Core.ISearchableItem, System.ComponentModel.INotifyPropertyChanged
public sealed class GeoprocessingProjectItem : ArcGIS.Desktop.Internal.Catalog.ItemInfo, ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Core.ISearchableItem, System.ComponentModel.INotifyPropertyChanged
{
//Gets a specific GeoprocessingProjectItem in the current project
// example: "myToolbox" is the name of the GeoprocessingProjectItem
GeoprocessingProjectItem gpProjItem = Project.Current.GetItems<GeoprocessingProjectItem>().FirstOrDefault(item => item.Name.Equals("myToolbox"));
// Use gpProjItem;
}
{
//Gets all the GeoprocessingProjectItem in the current project
var GPItems = Project.Current.GetItems<GeoprocessingProjectItem>();
foreach (var tbx in GPItems)
{
//Do Something with the toolbox
}
}
{
var gpItems = CoreModule.CurrentProject.Items.OfType<GeoprocessingProjectItem>();
// go through all the available toolboxes
foreach (var gpItem in gpItems)
{
var itemsInsideToolBox = gpItem.GetItems();
// then for each toolbox list the tools inside
foreach (var toolItem in itemsInsideToolBox)
{
string newTool = string.Join(";", [toolItem.Path, toolItem.Name]);
// do something with the newTool
// for example, add to a list to track or use them later
}
}
}
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Core.Item
ArcGIS.Desktop.GeoProcessing.GeoprocessingProjectItem
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)