ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / GeoprocessingOptions Class
Members Example

In This Topic
    GeoprocessingOptions Class
    In This Topic
    Gets and sets the available application geoprocessing options.
    Syntax
    Public Class GeoprocessingOptions 
    public class GeoprocessingOptions 
    Example
    Get GeoprocessingOptions
    {
      //These options are for behavior of interactive GP tools _only_.
    
      var overwrite_gp = ApplicationOptions.GeoprocessingOptions.OverwriteExistingDatasets;
      var remove_gp = ApplicationOptions.GeoprocessingOptions.RemoveOverwrittenLayers;
      var addoutput_gp = ApplicationOptions.GeoprocessingOptions.AddOutputDatasetsToOpenMap;
      var history_gp = ApplicationOptions.GeoprocessingOptions.WriteGPOperationsToHistory;
    }
    Set GeoprocessingOptions
    {
      //Note: changing these options modifies behavior of interactive GP tools _only_.
      //Use the ArcGIS.Desktop.Core.Geoprocessing.GPExecuteToolFlags enum parameter
      //to modify the behavior of Geoprocessing.ExecuteToolAsync(...)
    
      //Note: Needs QueuedTask to run
      {
        ApplicationOptions.GeoprocessingOptions.SetOverwriteExistingDatasets(true);
        ApplicationOptions.GeoprocessingOptions.SetRemoveOverwrittenLayers(false);
        ApplicationOptions.GeoprocessingOptions.SetAddOutputDatasetsToOpenMap(true);
        ApplicationOptions.GeoprocessingOptions.SetWriteGPOperationsToHistory(false);
      }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Core.GeoprocessingOptions

    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also