Is This Content Helpful?
We're glad to know this article was helpful.
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.
This script prints a copy of "Layout1" for each feaute in "Theme1.shp" in "View1". You may need to edit the script to reflect the name of your theme. layout and view.
'-- Define the layout, view and theme objects
aLayout = av.FindDoc("Layout1")
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
'-- 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)