Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Distinguished Mentor
Posts: 512
Registered: ‎03-02-2010
Message 1 of 2 (1,055 Views)

Lisp routine for page setup

1055 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
(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)
        (vl-remove (vla-get-name clyt) (layoutlist))
    (vla-copyfrom (vla-item Layts itm) clyt)


*Expert Elite*
Posts: 2,404
Registered: ‎12-15-2006
Message 2 of 2 (985 Views)

Re: Lisp routine for page setup

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




I am using often this nice routine MPL coming from a french forum (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


Bye, Pat ( Supporting Troops )
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Compliment) - Thanks
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.