• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    Mentor
    Posts: 246
    Registered: ‎03-02-2010

    Lisp routine for page setup

    254 Views, 1 Replies
    01-09-2013 01:44 PM

    Hi, as the title says I found a lisp routine on the internet to change page setups on multiple layouts. The lisp worked but on some of the layouts it moved the viewport off the paper background (see attached). The layouts print fine but the only way to get the viewport back on to the background is to open the page setup and click modify, then ok and close. I tested this on a .dwg that I had saved to my computer rather then on one in  the main folder but I would like to do this to to all are maps since our IT decided to rename our printer and now all pages setups are no good.All I know about lisp is how to run one. Could someone try this out and see if it works for them or maybe see whats wrong with the code? 

    ;; Copy current layout page setup to all layout tabs
    (vl-load-com)
    (defun c:CPS (/ Adoc Layts clyt)
      (setq aDoc  (vla-get-activedocument (vlax-get-acad-object))
     Layts (vla-get-layouts aDoc)
     clyt  (vla-get-activelayout aDoc)
      )
      (foreach
         itm
            (vl-remove (vla-get-name clyt) (layoutlist))
        (vla-copyfrom (vla-item Layts itm) clyt)
      )
      (princ)
    )

    Thanks

    Please use plain text.
    Distinguished Mentor
    braudpat
    Posts: 593
    Registered: ‎12-15-2006

    Re: Lisp routine for page setup

    01-18-2013 08:59 AM in reply to: sthompson1021

     

    Hello

     

    I am using often this nice routine MPL coming from a french forum www.cadxp.com (Author: Patrick_35)

    Attention: MPL.lsp + MPL.dcl

    so you have to copy these 2 files into your native AutoCAD folder

    or add the path (where are these 2 files) to the SUPPORT of your AutoCAD ...

     

    Bye, patrice

     

    Please use plain text.