ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core.Geoprocessing Namespace / GPItemException Class / GPItemException Constructor
Example

In This Topic
    GPItemException Constructor
    In This Topic
    Default constructor
    Syntax
    Public Function New( _
       ByVal gpResult As IGPResult _
    )
    public GPItemException( 
       IGPResult gpResult
    )

    Parameters

    gpResult
    Example
    Multi Ring Buffer
    {
      //The data referenced in this snippet can be downloaded from the arcgis-pro-sdk-community-samples repo
      //https://github.com/Esri/arcgis-pro-sdk-community-samples
      {
        var paramsArray = Geoprocessing.MakeValueArray(currentTemplate.MapMember.Name,
                    @"C:\Data\FeatureTest\FeatureTest.gdb\Points_MultipleRingBuffer",
                    new List<string> { "1000", "2000" }, "Meters", "Distance",
                    "ALL", "FULL");
    
        IGPResult gpResult = Geoprocessing.ExecuteToolAsync("Analysis.MultipleRingBuffer", paramsArray).Result;
        var messages = string.IsNullOrEmpty(gpResult.ReturnValue)
                ? $@"Error in Geoprocessing tool: {gpResult.ErrorMessages}"
                : $@"Ok: {gpResult.ReturnValue}";
        // use the messages and the result as needed
      }
    }
    Non-blocking execution of a Geoprocessing tool
    {
      //The data referenced in this snippet can be downloaded from the arcgis-pro-sdk-community-samples repo
      //https://github.com/Esri/arcgis-pro-sdk-community-samples
      string in_data = @"C:\tools\data.gdb\cities";
      string cities_buff = @"E:\data\data.gdb\cities_2km";
    
      var valueArray = Geoprocessing.MakeValueArray(in_data, cities_buff, "2000 Meters");
    
      // to let the GP tool run asynchronously without blocking the main thread
      // use the GPThread option of GPExecuteToolFlags
      //
      GPExecuteToolFlags flags = GPExecuteToolFlags.GPThread;  // instruct the tool run non-blocking GPThread
      IGPResult bufferResult = Geoprocessing.ExecuteToolAsync("Analysis.Buffer", valueArray, null, null, null, flags).Result;
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also