Originally Posted by
patricks
If I create a page setup, is there a way to apply it to all layouts when plotting? I have a file that was sent to me with 23 sheets (23 layout tabs), and of course all of them are set to someone else's print settings. Is there a fast way to set up one sheet and then apply that setup to all the layout tabs?
Here are two lisps that might help you out. The first one sets all tabs to a pre-determined page setup. The second one does the same thing but also plots all layout tabs in the drawing...in alphabetical order. Please note that I have not tested them out for 2006. They work in 2002 and 2005, though.
Code:
(defun c:2436-Oce (/ actlay doc layouts plot)
(setq doc (vla-get-activedocument (vlax-get-acad-object))
actlay (vla-get-activelayout doc)
layouts (vla-get-layouts doc)
plot (vla-get-plot doc)
)
(setq oldexpert (getvar "expert"))
(setq oldfiledia (getvar "filedia"))
(setvar "expert" 5)
(command "-psetupin" "L:/block/GCW/Sheet_Borders/Page setup-H.dwg" "2436-Oce")
(setvar "expert" oldexpert)
(setvar "filedia" oldfiledia)
(vlax-for itm layouts
(if (/= (strcase (vla-get-name itm)) "MODEL")
(progn
(vla-put-ActiveLayout doc itm)
(command "._plot" "no" "" "2436-Oce" "" "no" "YES" "NO")
)
)
)
(vla-put-ActiveLayout doc actlay)
(princ "\nAll Layout Tabs were Set to 2436-Oce (Bond)")
(princ)
)
Code:
(defun c:2436-Oceplot (/ actlay doc layouts plot)
(setq doc (vla-get-activedocument (vlax-get-acad-object))
actlay (vla-get-activelayout doc)
layouts (vla-get-layouts doc)
plot (vla-get-plot doc)
)
(setq oldexpert (getvar "expert"))
(setq oldfiledia (getvar "filedia"))
(setvar "expert" 5)
(command "-psetupin" "L:/block/GCW/Sheet_Borders/Page setup-H.dwg" "2436-Oce")
(setvar "expert" oldexpert)
(setvar "filedia" oldfiledia)
(vlax-for itm layouts
(if (/= (strcase (vla-get-name itm)) "MODEL")
(progn
(vla-put-ActiveLayout doc itm)
(command "._plot" "no" "" "2436-Oce" "" "no" "YES" "n")
(vla-PlotToDevice plot)
)
)
)
(vla-put-ActiveLayout doc actlay)
(princ "\nAll Layout Tabs were Set to 2436-Oce (Bond) and plotted")
(princ)
)