Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mxd = arcpy.mapping.MapDocument("CURRENT")
- #Change "CURRENT" to a path if not run in ArcMap. Then list all the data frames
- dfs = arcpy.mapping.ListDataFrames(mxd)
- ddp = mxd.dataDrivenPages
- parentDF = ddp.dataFrame
- #Next step is to pan the other data frames to the extent of the parent data frame's extent.
- for pageNum in range(1, ddp.pageCount + 1):
- for df in dfs:
- ddp.currentPageID = pageNum
- row = ddp.pageRow
- extent = row.Shape.extent
- if (df.name == parentDF.name) and (df.scale == parentDF.scale):
- df.panToExtent(extent)
- arcpy.mapping.ExportToPNG(mxd, r"C:\\Test_DDP\\" + str(pageNum) + ".png")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement