AnsweredAssumed Answered

Data driven pages: rotate two data frames

Question asked by scoggins on Dec 19, 2012
Latest reply on Dec 20, 2012 by scoggins

I have a map with two data frames, DFA and DFB. I have used data driven pages with DFA to provide location, scale, and rotation for the data frame. With DFB I have used the data frame properties (link to another data frame's extent) to link DFB to DFA to show the same location, and the same scale. All good so far. However, now I'm stuck trying to find a way to use the rotation of DFA (provided by the attribute table) with DFB. I have found a script on the forum, but keep getting errors:

import arcpy mxd = arcpy.mapping.MapDocument("My_MAP") mainDF = arcpy.mapping.ListDataFrames(mxd, "DFA") locatorDF = arcpy.mapping.ListDataFrames(mxd, "DFB")  for DDP_Page in range(1, mxd.dataDrivenPages.pageCount + 1): mxd.dataDrivenPages.currentPageID = DDP_Page Rotate = mxd.dataDrivenPages.pageRow.Rotate #where Rotate is the name of the field in the attribute with the rotation values   locatorDF.rotation = Rotate

The script fails at the locatorDF.rotation = Rotate line. I'm not sure if I need to go beyond this script to achieve what I want. I have made other scripts that simply export each data frame as a pdf. However, I want to simply rotate DFB to the same angle as DFA, then export the entire map as a pdf. I have added an extra piece of code to export to pdf. Any help would be much appreciated. I'm getting better with Python, but it still takes me some time to get a script up and running.

Thanks in advance.