ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.GeoProcessing Namespace / GeoprocessingProjectItem Class
Members Example

In This Topic
    GeoprocessingProjectItem Class
    In This Topic
    Represents a GeoProcessing project item.
    Object Model
    GeoprocessingProjectItem ClassTimeInstant Class
    Syntax
    public sealed class GeoprocessingProjectItem : ArcGIS.Desktop.Internal.Catalog.ItemInfo, ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Core.ISearchableItem, System.ComponentModel.INotifyPropertyChanged  
    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 
    Example
    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
              }
          }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Core.Item
                ArcGIS.Desktop.GeoProcessing.GeoprocessingProjectItem

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also