Select to view content in your preferred language

Extent of map in ArcGIS PRO

10301
11
Jump to solution
03-06-2018 04:39 PM
DavidMatthews3
Occasional Contributor

In the transition from arcpy.mapping to arcpy.mp there doesn't seem to be a way to get the extent (in order to calculate the center)  of the current map.The camera extent only applies to layouts and MapFrames.

Does anyone know how to get around this?

Something like

aprx=arcpy.mp.ArcGISProject("CURRENT")
mapView = aprx.listMaps()[0]
extent = mapView.extent

Is this possible in pro?

Tags (2)
11 Replies
ToyotaT18
Regular Contributor

I was looking for similar, thought I'd post the answer here in case anyone else was looking.

You can use aprx.activeView.camera.getExtent()

SRK
by
Occasional Contributor

@ToyotaT18This should be the accepted answer as this solution works without saving the project and always grabs the current view of the map currently looked at.

0 Kudos