AnsweredAssumed Answered

Matching Rotation Between Data Frames Using Data Driven Pages

Question asked by adaminglis on Mar 12, 2012
Latest reply on Oct 18, 2019 by orkhan.abdullayev90
I've created a DataDriven Pages (DDP) MXD with two main data frames of a proposed road.  I want both data frames to have the same extents and the same rotation.  The top data frame is controlled by DDP and the rotation is set by a field in the Strip Map Index.  I've set the bottom data frame to match the extents of the top data frame through the Data Frame Properties > Data Frame tab, however, there is no option to match the rotation to the top data frame.  So I turned to python and hacked together a simple script to set the rotation of the bottom data frame to match the top data frame:

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") topDF = arcpy.mapping.ListDataFrames(mxd, "Top")[0] bottomDF = arcpy.mapping.ListDataFrames(mxd, "Bottom")[0]  for DDP_Page in range(1, (mxd.dataDrivenPages.pageCount + 1)):     mxd.dataDrivenPages.currentPageID = DDP_Page     angle = mxd.dataDrivenPages.pageRow.angle      bottomDF.rotation = angle

The problem with the above script is that it overwrites bottom data frame's rotation setting with every iteration through the for loop.  So after running the script, the rotation of the bottom data frame on every page is set to the rotation of the last page of the top frame.  I suppose one way around this might be to export out a PDF within the FOR loop.  Any other suggestions?