jpaine

Using arcpy to switch to layout view

Discussion created by jpaine on Jun 15, 2011
Latest reply on Jun 15, 2011 by clm42
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

Outcomes