Get Map rotation

639
1
01-06-2011 08:42 AM
FrancisMoisan
New Contributor II
Hi,
Ive created a vb macro that will create a text file at the seme place as my mxd file.  The text file contain some information about my mxd like the name of the mxd.  I need to had the rotation of the active dataframe but I can't find the way to do that.  I suppose it's simple but I can't get it.

Any Help on how to get the maprotation to a text string?
tnx
0 Kudos
1 Reply
JeffBarrette
Esri Regular Contributor
Francis,

At 10.0, if your mxd is in page layout view, the mxd.activeView returns "PAGE_LAYOUT" (and not the active data frame within the layout).  You would need to find the data frame by name (or loop through each df) and return the rotation accordingly. 

If you are in data view, the mxd.activeView returns the active dataframe.  At that point you can get the df.rotation value.

At 10.1 we plan to introduce a new MapDocument property called ActiveDataFrame which will be r/o and will return a reference to a data frame object regardless of data view or layout view.

Jeff
0 Kudos