AnsweredAssumed Answered

Need to wait for map to draw before changing extent via ArcPy

Question asked by dlcgis2 on Oct 9, 2020
Latest reply on Oct 9, 2020 by d.shaw-esristaff

I have a simple Python script that iterates between map extents:

 

aprx = arcpy.mp.ArcGISProject("CURRENT")
lyt = aprx.listLayouts("Layout")[0]
mf = lyt.listElements("MAPFRAME_ELEMENT", "Map*")[0]

mf.camera.setExtent(arcpy.Extent(330611.83,5553892.48,330863.45,5554011.54))
mf.camera.setExtent(arcpy.Extent(330048.80,5553500.43,332061.75,5554452.93))
mf.camera.setExtent(arcpy.Extent(323271.40,5544979.88,331323.22,5548789.89))
mf.camera.setExtent(arcpy.Extent(326568.38,5548818.46,327071.62,5549056.59))

 

It appears the map extent changes but does not wait for the map to draw completely before going to the next extent. Any idea how to force the setExtent to wait for the map to draw?

 

Thanks!

 

M

Outcomes