Apply PageSetup

Samir

Usenet Archive
Joined
Jan 20, 2004
Messages
1
Reaction score
0
I hope this is not a repeated question.

In AutoCAD 2002, how I can get the list of PageSetup(s) inside a drawing file and apply certain one to one or all layouts?
Any help is appreciated.

Thanks
Samir
 
Here is one way to get the job done.

; Jason Piercey . May 16th, 2003
; assign a pagesetup to a layout
; [document] - vla-object, layout object
; [layout] - string, layout name
; [setup] - string, pagesetup to assign
; return: T or nil
; example: (putPagesetup [document] [layout] [setup])
; revised: July 27th, 2003
; trimmed off the fat and used (vl-catch-all.....)
(defun putPagesetup (document layout setup)
(if
(vl-catch-all-error-p
(vl-catch-all-apply
(function
(lambda
(vla-copyfrom
(vla-item (vla-get-layouts document) layout)
(vla-item (vla-get-plotconfigurations document) setup)
)
)
)
)
)
nil
t
)
)

To assign a pagesetup named "test" to all layouts defined in the current document.

(setq *doc* (vla-get-activedocument (vlax-get-acad-object))) (foreach x (layoutlist) (putPagesetup *doc* x "test"))
 

Latest threads

Back
Top