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:
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps("Maps*")
lyt = aprx.listLayouts("Layout*")
lyr = m.listLayers("Layer*")
mf = lyt.listElements("mapframe_element", "MapFrame*")
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!