Using arcpy to switch to layout view

3852
1
06-15-2011 11:00 AM
JuliePaine
New Contributor II
Looking for arcpy syntax to change a mxd from data view to layout view and zoom to a certain scale. The following works to change from layout view to data view, but I also need the opposite. Thanks all!

import arcpy, arcpy.mapping as map, sys, os
mxd = map.MapDocument("CURRENT")
data_frame = map.ListDataFrames(mxd)[0]
# Switch to data view
mxd.activeView=data_frame.name
for df in map.ListDataFrames(mxd):
df.scale=2400
arcpy.RefreshActiveView()
del mxd
Tags (2)
0 Kudos
1 Reply
ChrisMathers
Occasional Contributor III
mxd.activeView='PAGE_LAYOUT' should do it.