A simple way to move multiple data frames is to:
- Get a list of all data frames
- Identify the parent data frame
- Move the extents of the other data frame
Sounds simple? Well it is.
To get started, get a reference to the map document
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)
Now how do you know what data frame is the parent data frame or what data frame is a child data frame? Luckily at 10.1, the data driven page object provides a property called dataFrame, which returns the DataFrame object. At 10.0, you would either use names or indexing values to determine which is the parent or not, but this example is for 10.1.
ddp = mxd.dataDrivePages
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):
print 'I found the parent frame'
else:
df.panToExtent(extent)
arcpy.mapping.ExportToPNG(mxd, r"C:\Project\OutPut\ParcelAtlas_" + str(pageNum) + ".png")
Here we have a bunch of code that loops through each data driven page area and then modifies each underlying data frame that isn't the parent. After the data frames are changes, the code then exports the maps to PNG to the '...\output' folder with reference to the page number.
Enjoy