The Extent geoprocessing environment setting documentation here:
https://pro.arcgis.com/en/pro-app/tool-reference/environment-settings/output-extent.htm
lists "Same as Display" under the dialog syntax, but not under the scripting syntax. I am building a script tool that requires "Same as Display" to be set as a default.
Could someone share a snippet of code that demonstrates how I would set arcpy.env.extent to get the same effect as setting "Same as Display" in the dialog window?
Hi Eric,
You should be able to use the following snippet provided the user is running the tool from within Pro and has the map view open.
Warren
aprx = arcpy.mp.ArcGISProject("CURRENT")
mv = aprx.activeView
ext = mv.camera.getExtent()
arcpy.env.extent = "{}, {}, {}, {}".format(ext.XMin, ext.YMin, ext.XMax, ext.YMax)
Thanks, you rock! Cut down a process using feature services as inputs from 13 minutes to 32 seconds.