Author Topic: Page set up  (Read 1470 times)

0 Members and 1 Guest are viewing this topic.

Nardino

  • Newt
  • Posts: 97
Page set up
« on: January 25, 2017, 03:11:38 PM »
Hello to all
I have a few hundred drawings that have 3 named page set ups. Does anybody know how create a lisp or script so that I can make current a certain page set up?
thanks

ChrisCarlson

  • Guest
Re: Page set up
« Reply #1 on: January 25, 2017, 04:08:32 PM »
Code - Auto/Visual Lisp: [Select]
  1. ;;; Set a named page setup as current on current layout by avoiding command usage http://jtbworld.com/autocad-pagesetup-lsp
  2. ;;; (SetCurrentPageSetup <AcadDocument> <PageSetupName>)
  3. ;;; (SetCurrentPageSetup (vla-get-activedocument (vlax-get-acad-object)) "Setup2")
  4. (defun SetCurrentPageSetup (doc pcname / layout PlotConfig)
  5.   (setq layout (vla-get-activelayout doc))
  6.   (setq PlotConfig (vl-catch-all-apply
  7.                      'vla-item
  8.                      (list
  9.                        (vla-get-PlotConfigurations
  10.                          doc
  11.                        )
  12.                        pcname
  13.                      )
  14.                    )
  15.   )
  16.   (if (not (vl-catch-all-error-p PlotConfig))
  17.     (vla-copyfrom layout PlotConfig)
  18.   )
  19. )

JTB wrote a pretty nifty page setup function, will be pretty straight forward in combining this with a script for batch processing.

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Page set up
« Reply #2 on: January 25, 2017, 05:12:56 PM »
If that doesn't work out for you, I might be able to dig one up from my archives for you.
CAD Tech

Nardino

  • Newt
  • Posts: 97
Re: Page set up
« Reply #3 on: January 26, 2017, 10:57:27 AM »
Thanks for the code. It saved a lot of time  :2funny: