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
Solved! Go to Solution.
import arcpy mxd = arcpy.mapping.MapDocument("My_MAP") mainDF = arcpy.mapping.ListDataFrames(mxd, "DFA")[0] locatorDF = arcpy.mapping.ListDataFrames(mxd, "DFB")[0] 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
locatorDF.rotation = mainDF.rotation
import arcpy mxd = arcpy.mapping.MapDocument("My_MAP") mainDF = arcpy.mapping.ListDataFrames(mxd, "DFA")[0] locatorDF = arcpy.mapping.ListDataFrames(mxd, "DFB")[0] 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
locatorDF.rotation = mainDF.rotation
import arcpy mxd = arcpy.mapping.MapDocument(r"G:\WORKSPACE\Test.mxd") ddpDF = arcpy.mapping.ListDataFrames(mxd, "Top")[0] #Replace name of DDP Data Frame otherDF = arcpy.mapping.ListDataFrames(mxd, "Bottom")[0] #Replace name of Other Data Frame you want to rotate for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): mxd.dataDrivenPages.currentPageID = pageNum otherDF.rotation = ddpDF.rotation arcpy.mapping.ExportToPDF(mxd, r"G:\WORKSPACE\Page_" + str(pageNum) + ".pdf") del mxd