TheSwamp
CAD Forums => CAD General => Topic started by: ELOQUINTET on December 16, 2003, 08:25:14 AM
-
hey was just wondering if anyone has come up with an easier way of creating multiple layout tabs. also is there a way to set the create a copy box to be checked as default? this has annoyed for for a long time so i hope there's a solution...
dan
-
template file ?
-
yes i have a template file but unfortunately others here don't and i have to work with their drawings sometimes so... what about making the copy function as default that i find real annoying. thanks hendie
dan
-
real simple and there's probably loads of ways to do it... but... make a button and ...
^C^C_layout;copy;"";;
-
thanks i'll give that a try :D
dan
-
works great but how would i write that to do multiple copies hendie?
dan
-
you would need to rewrite it as a Lisp routine and prompt the user for the number of "copies" to create
-
Or just put a * in front of the command: ^C^C*_layout etc. Might be a little clunky, but it'll make the macro repeat.
-
or:
;;; this file requires the 'Swamp VL-Toolkit' in order to run successfully ;;;
;;; http://theswamp.org/swamp.files/Public/AcadApp.lsp ;;;
(DEFUN C:addlayouts (/ LAYLST LOUTSNUM N)
(VL-LOAD-COM) ; or else
(setq LoutsNum (getint "Enter the number of layouts to create: "))
(setq Laylst (vla-get-layouts (get-active-document)))
(setq n (vlax-get-property laylst 'count))
(setq Loutsnum (+ n loutsnum))
(while (< n LoutsNum)
(vla-add Laylst (strcat "Layout X" (rtos n)))
(setq n (1+ n))
)
)
probably a dumb way to do it but.....
*edited to include the 'Swamp toolkit'*
-
no go hendie here's what i get:
Command: ADDLAYOUTS
Enter the number of layouts to create: 5
; error: no function definition: GET-ACTIVE-DOCUMENT
Command:
am i missing something?
dan
-
Dan, surely you've haunted these forums long enough to recognise the (get-active-document) & (get-acad-object) routines from Mark & Se7en & company. I always forget... are those routines yours Mark ?
if you do a search here or at cadalog, you'll find them easily enough.
-
Here is what I use;
http://theswamp.org/mark.lisp/files/Tools/MST-aamp.lsp
-
mark not quite sure how to work this
-
Dan, change the line
(setq Laylst (vla-get-layouts (get-active-document)))
to
(setq Laylst (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
... or click 5 times on the button holding the menu macro mentioned earlier.
-
If the swamp toolkit resides in another file and has never been loaded, should we load it in the routine like (load "acadapp")?
-
There's probably a few ways to do it but I have mine called VLapps.lsp and load it from the acaddoc.lsp at startup.
(load "VLapps")
that way, it's always there when I need it.