HOW TO
You can use Avenue to print multiple versions of a single layout at different extents. The script in this article is a typical example of working with views, layouts, view frames, and using different extents on a display.
Code:
'-- Define the layout, view and theme objects
aLayout = av.FindDoc("Layout1")
aLayout.GetGraphics.Empty
aView = av.FindDoc("View1")
aTheme = aView.FindTheme("Theme1.shp")
aFtab = aTheme.GetFtab
'-- Create a ViewFrame object (vf)
origin = aLayout.GetDisplay.ReturnMarginExtent.ReturnOrigin+(1@1)
vf = ViewFrame.Make( Rect.Make( origin,(5@5)))
'-- Add the ViewFrame object (vf) to the layout and
'-- set the view of the ViewFrame to aView
aLayout.GetGraphics.Add(vf)
vf.SetView(aView,TRUE)
'-- Loop for each feature in "Theme1.shp"
'-- Set the extent of aView's Display to the extent returned for a feature (p)
'-- The display is returned with the request aView.GetDisplay
'-- The Fill Object of the ViewFrame is set to aView.
'-- aLayout is sent the Print command.
'-- Note: If you have 10 features, you will get 10 printed maps
for each rec in aFtab
p = aFtab.ReturnValue(aFtab.GetFields.Get(0),rec)
aView.GetDisplay.SetExtent(p.ReturnExtent)
'aView.GetDisplay.Flush
'aView.Invalidate
vf.SetFillObject(aView)
aLayout.Print
end
Get help from ArcGIS experts
Download the Esri Support App