You can do it via code.
import arcpy
#Reference the Project document from within PRO
aprx = arcpy.mp.ArcGISProject("CURRENT")
#Reference the layout
lyt = aprx.listLayouts("your_layout_name_here")[0]
#Get the Map Frame
mf = lyt.listElements("mapframe_element", "your_mapframe_name")[0]
extent = mf.camera.getExtent()
polygon = extent.polygon
You then have a polygon object that you can work with.
Note that this code just grabs the extent, if the map frame is rotated, the extent doesn't match what you see on screen.
Using tools in ArcToolbox
Create Fishnet (Data Management)—ArcGIS Pro | Documentation
You can do it via code.
import arcpy
#Reference the Project document from within PRO
aprx = arcpy.mp.ArcGISProject("CURRENT")
#Reference the layout
lyt = aprx.listLayouts("your_layout_name_here")[0]
#Get the Map Frame
mf = lyt.listElements("mapframe_element", "your_mapframe_name")[0]
extent = mf.camera.getExtent()
polygon = extent.polygon
You then have a polygon object that you can work with.
Note that this code just grabs the extent, if the map frame is rotated, the extent doesn't match what you see on screen.
Thank you sir! This worked marvelously.
Hi Mark,
Can you please indicate how to save the extent as a feature class? I tried InsertCursor but it didn't accept the polygon object, it requires list of floats instead.
Many thanks,
Katerina.
Using tools in ArcToolbox
Create Fishnet (Data Management)—ArcGIS Pro | Documentation
Dan this works great as well! Thank you.
This worked great! Thank you!