TheSwamp

CAD Forums => CAD General => Topic started by: ELOQUINTET on December 16, 2003, 08:25:14 AM

Title: creating multpile layout tabs?
Post 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
Title: creating multpile layout tabs?
Post by: hendie on December 16, 2003, 08:26:25 AM
template file ?
Title: creating multpile layout tabs?
Post by: ELOQUINTET on December 16, 2003, 08:43:10 AM
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
Title: creating multpile layout tabs?
Post by: hendie on December 16, 2003, 09:01:03 AM
real simple and there's probably loads of ways to do it... but... make a button and ...
Code: [Select]
^C^C_layout;copy;"";;
Title: creating multpile layout tabs?
Post by: ELOQUINTET on December 16, 2003, 09:06:27 AM
thanks i'll give that a try  :D

dan
Title: creating multpile layout tabs?
Post by: ELOQUINTET on December 16, 2003, 10:12:06 AM
works  great but how would i write that to do multiple copies hendie?

dan
Title: creating multpile layout tabs?
Post by: hendie on December 16, 2003, 10:17:10 AM
you would need to rewrite it as a Lisp routine and prompt the user for the number of "copies" to create
Title: creating multpile layout tabs?
Post by: Kate M on December 16, 2003, 10:24:03 AM
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.
Title: creating multpile layout tabs?
Post by: hendie on December 16, 2003, 11:11:51 AM
or:
Code: [Select]

;;; 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'*
Title: creating multpile layout tabs?
Post by: ELOQUINTET on December 16, 2003, 11:23:46 AM
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
Title: creating multpile layout tabs?
Post by: hendie on December 16, 2003, 11:28:50 AM
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.
Title: creating multpile layout tabs?
Post by: Mark on December 16, 2003, 01:03:41 PM
Here is what I use;
http://theswamp.org/mark.lisp/files/Tools/MST-aamp.lsp
Title: creating multpile layout tabs?
Post by: ELOQUINTET on December 16, 2003, 03:28:08 PM
mark not quite sure how to work this
Title: creating multpile layout tabs?
Post by: SMadsen on December 16, 2003, 07:01:01 PM
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.
Title: creating multpile layout tabs?
Post by: daron on December 17, 2003, 09:13:01 AM
If the swamp toolkit resides in another file and has never been loaded, should we load it in the routine like (load "acadapp")?
Title: creating multpile layout tabs?
Post by: hendie on December 17, 2003, 09:26:26 AM
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.
Quote
(load "VLapps")
that way, it's always there when I need it.