Apply PageSetup

Discussion in 'AutoCAD' started by Samir, Jan 20, 2004.

  1. Samir

    Samir Guest

    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
     
    Samir, Jan 20, 2004
    #1
  2. 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 Piercey, Jan 20, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.