ArcGIS Pro 2.7 API Reference Guide
MakeEnvironmentArray Method
Example 

ArcGIS.Desktop.Core.Geoprocessing Namespace > Geoprocessing Class : MakeEnvironmentArray Method
Helper function to create environment array, use named argument to set individual value.
Syntax
Public Shared Function MakeEnvironmentArray( _
   Optional ByVal autoCommit As Nullable(Of Integer), _
   Optional ByVal XYResolution As Object, _
   Optional ByVal XYDomain As Object, _
   Optional ByVal scratchWorkspace As Object, _
   Optional ByVal cartographicPartitions As Object, _
   Optional ByVal terrainMemoryUsage As Object, _
   Optional ByVal MTolerance As Object, _
   Optional ByVal compression As Object, _
   Optional ByVal coincidentPoints As Object, _
   Optional ByVal randomGenerator As Object, _
   Optional ByVal outputCoordinateSystem As Object, _
   Optional ByVal overwriteoutput As Nullable(Of Boolean), _
   Optional ByVal rasterStatistics As Object, _
   Optional ByVal ZDomain As Object, _
   Optional ByVal transferDomains As Nullable(Of Boolean), _
   Optional ByVal resamplingMethod As Object, _
   Optional ByVal snapRaster As Object, _
   Optional ByVal cartographicCoordinateSystem As Object, _
   Optional ByVal configKeyword As Object, _
   Optional ByVal outputZFlag As Object, _
   Optional ByVal qualifiedFieldNames As Nullable(Of Boolean), _
   Optional ByVal tileSize() As Double, _
   Optional ByVal parallelProcessingFactor As Object, _
   Optional ByVal pyramid As Object, _
   Optional ByVal referenceScale As Object, _
   Optional ByVal extent As Object, _
   Optional ByVal XYTolerance As Object, _
   Optional ByVal tinSaveVersion As Object, _
   Optional ByVal nodata As Object, _
   Optional ByVal MDomain As Object, _
   Optional ByVal cellSize As Object, _
   Optional ByVal outputZValue As Object, _
   Optional ByVal outputMFlag As Object, _
   Optional ByVal geographicTransformations As Object, _
   Optional ByVal ZResolution As Object, _
   Optional ByVal mask As Object, _
   Optional ByVal maintainSpatialIndex As Nullable(Of Boolean), _
   Optional ByVal workspace As Object, _
   Optional ByVal MResolution As Object, _
   Optional ByVal ZTolerance As Object _
) As IReadOnlyList(Of KeyValuePair(Of String,String))

Parameters

autoCommit
XYResolution
XYDomain
scratchWorkspace
cartographicPartitions
terrainMemoryUsage
MTolerance
compression
coincidentPoints
randomGenerator
outputCoordinateSystem
overwriteoutput
rasterStatistics
ZDomain
transferDomains
resamplingMethod
snapRaster
cartographicCoordinateSystem
configKeyword
outputZFlag
qualifiedFieldNames
tileSize
parallelProcessingFactor
pyramid
referenceScale
extent
XYTolerance
tinSaveVersion
nodata
MDomain
cellSize
outputZValue
outputMFlag
geographicTransformations
ZResolution
mask
maintainSpatialIndex
workspace
MResolution
ZTolerance

Return Value

An IEnumerable of key-value pairs of type strings.
Example
// get the syntax of the tool from Python window or from tool help page
string in_features = @"C:\data\data.gdb\HighwaysWeb84";
string out_features = @"C:\data\data.gdb\HighwaysUTM";
var param_values = Geoprocessing.MakeValueArray(in_features, out_features);

// crate the spatial reference object to pass as an argument to management.CopyFeatures tool
var sp_ref = await QueuedTask.Run(() => {
    return SpatialReferenceBuilder.CreateSpatialReference(26911);    // UTM 83 11N: 26911
});

// set output coordinate system environment           
var environments = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: sp_ref);
// set environments in the 3rd parameter
var gp_result = await Geoprocessing.ExecuteToolAsync("management.CopyFeatures", param_values, environments, null, null, GPExecuteToolFlags.AddOutputsToMap);
            
Geoprocessing.ShowMessageBox(gp_result.Messages, "Contents", GPMessageBoxStyle.Default, "Window Title");

//return gp_result;
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Geoprocessing Class
Geoprocessing Members