Author Topic: creating multpile layout tabs?  (Read 9445 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
creating multpile layout tabs?
« 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

hendie

  • Guest
creating multpile layout tabs?
« Reply #1 on: December 16, 2003, 08:26:25 AM »
template file ?

ELOQUINTET

  • Guest
creating multpile layout tabs?
« Reply #2 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

hendie

  • Guest
creating multpile layout tabs?
« Reply #3 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;"";;

ELOQUINTET

  • Guest
creating multpile layout tabs?
« Reply #4 on: December 16, 2003, 09:06:27 AM »
thanks i'll give that a try  :D

dan

ELOQUINTET

  • Guest
creating multpile layout tabs?
« Reply #5 on: December 16, 2003, 10:12:06 AM »
works  great but how would i write that to do multiple copies hendie?

dan

hendie

  • Guest
creating multpile layout tabs?
« Reply #6 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

Kate M

  • Guest
creating multpile layout tabs?
« Reply #7 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.

hendie

  • Guest
creating multpile layout tabs?
« Reply #8 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'*

ELOQUINTET

  • Guest
creating multpile layout tabs?
« Reply #9 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

hendie

  • Guest
creating multpile layout tabs?
« Reply #10 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.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
creating multpile layout tabs?
« Reply #11 on: December 16, 2003, 01:03:41 PM »
TheSwamp.org  (serving the CAD community since 2003)

ELOQUINTET

  • Guest
creating multpile layout tabs?
« Reply #12 on: December 16, 2003, 03:28:08 PM »
mark not quite sure how to work this

SMadsen

  • Guest
creating multpile layout tabs?
« Reply #13 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.

daron

  • Guest
creating multpile layout tabs?
« Reply #14 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")?