GeoprocessingProjectItem Class
Get a specific "GeoprocessingProjectItem"
GeoprocessingProjectItem GPProjItem = Project.Current.GetItems<GeoprocessingProjectItem>().FirstOrDefault(item => item.Name.Equals("myToolbox"));
Get all GeoprocessingProjectItems in a project
//Gets all the GeoprocessingProjectItem in the current project
var GPItems = Project.Current.GetItems<GeoprocessingProjectItem>();
foreach (var tbx in GPItems)
{
//Do Something with the toolbox
}
Get Geoprocessing project items
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(";", new string[] { toolItem.Path, toolItem.Name });
// do something with the newTool
// for example, add to a list to track or use them later
}
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.