Hi
How do I update/set an environment setting in ArcGIS PRO using C# ?
Best regards,Jens Søe
@pocalipse ,@CharlesMacleod is correct that there is not a way through the Pro .NET API to change or set Geoprocessing Environments for your project. @pocalipse can you explain what your intention is for having an Add-in or Extension or other SDK element setting the project Geoprocessing environments? @CharlesMacleod mentioned the MakeEnvironmentArray function, which you can use to set all of desired environment settings, then reuse that environment array for any tools you run using ExecuteToolAsync, so the effect can be quite similar to setting the environments to the project. For example (pseudo code)
var env = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: a_spatial_reference, extent: an_extent_window); Geoprocessing.ExecuteToolAsync(tool1, params1, env); Geoprocessing.ExecuteToolAsync(tool2, params2, env); Geoprocessing.ExecuteToolAsync(tool3, params3, env);
Maybe you have a different reason for setting the project's geoprocessing environments beyond their use for environments used in the tools you execute in an Add-in. Please let us know any details for this request.
Since this is the SDK Questions forum, and the question is answered that we do not have a function to set project environments in .NET, if you would like to submit an idea like "Update project's geoprocessing environments using .NET" to the ArcGIS Pro Ideas site, we can get comments from the user community and use that to try to prioritize this new development work. https://community.esri.com/t5/arcgis-pro-ideas/idb-p/arcgis-pro-ideas
Gotcha. it's not supported. i'll take this as a new requirement for GP
That is when you want to use the setting, but how do I change a setting and save it in the my project?
Pls use:
Geoprocessing.MakeEnvironmentArray
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9386.html
There are examples on that page
Hi @CharlesMacleod
It isn't he system environments variables I'm seeking - it is the list of environment settings in ArcGIS PRO found under the analysis TAB:
It is pretty easy in Python but how do I set these using .net ?
eg: https://stackoverflow.com/questions/185208/how-do-i-get-and-set-environment-variables-in-c
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.