ArcGIS Pro 3.0 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: setting GeoprocessingOptions requires the QueuedTask
    QueuedTask.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, Windows 10, Windows 8.1

    See Also