Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Valued Mentor
Posts: 477
Registered: ‎03-02-2010
Message 1 of 2 (937 Views)

Lisp routine for page setup

937 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,099
Registered: ‎12-15-2006
Message 2 of 2 (867 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

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.