arcpy DF extent coords don't reflect rotation?

860
5
08-04-2011 10:34 AM
RyanKelley
New Contributor II
I have a script that cycles through a directory of mxd's and creates a polygon of each mxd's dataframe's bounding box. Therefore, we can have one layer to use as an index layer for a map book. 

However, several of the mxd's have a data frame rotated to something other than 0.  The coordinates of the DF extent are being calcluated as if the rotation is always 0, and therefore my polygons are always right angled at true north, rather than reflecting the angle of the data frame.

Is there a way to calculate the real DF extent boundaing box of a rotated data frame?

thanks,
ryan
0 Kudos
5 Replies
JeffBarrette
Esri Regular Contributor
This is a bug.  It will be addressed as soon as possible.  If you are interested in tracking it, the ID is NIM071401.

Thanks for reporting this!
Jeff
0 Kudos
JosephKnieriem
New Contributor
I'm still running into this issue with Arc 10 SP 4.  Did this issue ever get resolved and is there a workaround I can use in the mean time?
0 Kudos
JeffBarrette
Esri Regular Contributor
This unfortunately was not addressed for SP4.  10.1 will be the next release that addresses the issue.

Jeff
0 Kudos
KarenThomas1
New Contributor
Any update on if this has been addressed yet??? I'm running on 10.1 SP1 and I am still getting the same extent for rotated dataframes. Please let me know of any workaround options.
0 Kudos
JeffBarrette
Esri Regular Contributor
I just verified this and it is working at 10.1.  If df.rotation=0 my x and y min/max values appear in the expected LL and UR corners.  If I set df.rotation = 45. It reports back to me the correct min/max values but they do not appear in the same locations.  Because the df was rotated, my MinY appears in the LR corner and my MaxY appears in the UL corner.

Is this what you were seeing but expected to get LL and UR coordinates? 

When you rotate a df you can't expect X values to remain constant along the top and bottom of the frame.

If you want the coordinates in the corners of the df, then one possible solution would be to convert the extent rectangle into 4 points and then read the coordinates.

Jeff
0 Kudos