I'm rewriting a Python 2.x script so that it can be used in Pro. I am struggling to figure out the syntax for refreshing a map series in Python. I found this page: MapSeries—ArcPy | ArcGIS Desktop, and I know there is a refresh() method, but I cannot figure out how to use it. I tried
lyt = aprx.listLayouts("AgLayout")[0]
for lyr in m.listLayers("Parcel*"):
lyr.definitionQuery = "JOINPIN = '201-02-0-00-00-012.03-0'"
lyt.refresh()
Line 6 throws an error that says "AttributeError: 'Layout' object has no attribute 'refresh'
You need to access the mapSeries property of the Layout object, since refresh() is a method of the mapSeries object. Something like lyt.mapSeries.refresh().