Hi,
I'm trying to take a table of polygons that split my physical area of interest into 700 chunks. I'm tasked with taking each section and putting it into a layout for making backup paper maps. The layout is no problem, it's the automating of showing the selected section in the map frame that is not working for some reason. I'm new to ArcPy but my research so far seems to point to arcp.da.SearchCursor as the class to carry this out. Like so:
import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Maps*")[0]
lyt = aprx.listLayouts("Layout*")[0]
lyr = m.listLayers("Layer*")[0]
mf = lyt.listElements("mapframe_element", "MapFrame*")[0]
fc = "Sections"
field = "OBJECTID"
with arcpy.da.SearchCursor(fc, field) as cursor:
for row in cursor:
mf.camera.setExtent(mf.getLayerExtent(lyr/row?, True, False)
# and then here I would save to PDF
del row, cursor
Judging by my code so far, I think I'm trying to zoom into the wrong thing and that something else is missing. I'm using ArcGIS Pro 2.4.0. Appreciate any assistance, thanks!
Solved! Go to Solution.
Have you considered a Map Series (what was known as Data Driven Pages in Desktop)?
Have you considered a Map Series (what was known as Data Driven Pages in Desktop)?
I never even considered ESRI had a built-in feature for this exact purpose. It works exactly the way I need and is way easier. Thank you!