PDA

View Full Version : LISP ROUTINE TO ERASE ALL PAPERSPACE LAYOUTS


stephen.coff
2007-07-16, 09:45 AM
Guys,
Does anyone have a LISP Routine to erase all the paperspace tabs and layouts on a drawing ? If so could i get a copy, please ?

Stephen

CADmium
2007-07-16, 11:34 AM
(vl-load-com)
(vlax-for LAYOUT (vla-get-layouts(vla-get-activedocument(vlax-get-acad-object)))
(vl-catch-all-apply 'vla-delete (list LAYOUT))
)

,but one Paperspacelayout (the last active) cannot deleted

stephen.coff
2007-07-16, 11:57 AM
Thanks Thomas.

stephen.coff
2007-07-16, 12:05 PM
Thomas,
Do you know if or how to rename the last active paperspace tab left ?
I can have it erase everything on that tab though would like to be able to rename it back to paperspace.

Stephen

CADmium
2007-07-16, 01:02 PM
Try this


(vlax-for LAYOUT (vla-get-layouts(vla-get-activedocument(vlax-get-acad-object)))
(cond
((>(vla-get-taborder LAYOUT)1)
(vl-catch-all-apply 'vla-delete (list LAYOUT))
)
((=(vla-get-taborder LAYOUT)1)
(not(vl-catch-all-error-p (vl-catch-all-apply 'vla-put-name(list LAYOUT "PAPER"))))
)
)
)

stephen.coff
2007-07-16, 01:57 PM
Thanks alot Thomas, that has made the task of preparing drawings a little easier.

Stephen