Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp routine for page setup

3 REPLIES 3
Reply
Message 1 of 4
sthompson1021
4305 Views, 3 Replies

Lisp routine for page setup

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

3 REPLIES 3
Message 2 of 4
braudpat
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

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 3 of 4
michaeljcobb
in reply to: braudpat

For the record, I found this LISP routine very helpful. Changed the french to english and I was good to go. Merci beaucoup!

 

Mike

Message 4 of 4

Hi, there are a lot of similar routines in the web.

One of my favourite is this written by Ronjob. You can find it here.

 

Chris

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost