Thanks Jason,
It works great. Do you know of a similar way get it in VBA?
I'm trying to display the available Pagesetup(s) into a dropdown list.
Thank you,
Samir
"Jason Piercey" wrote in message
news:<400d7c57$1_2@newsprd01>...
> 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"))
>
>
>
> --
>
> -Jason
> Member of the Autodesk Discussion Forum Moderator Program
>
>
> "Samir" wrote in message
> news:400d6cd8$1_3@newsprd01...
> > 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
> >