Jump to content

import all layouts from specific template


Recommended Posts

Posted

Hi All,

 

Been looking for something to allow me to import all layouts from a specific template via a lisp command. I managed to find the code below which works great, but it only imports 1 layout at a time.

Can the code below be amended to include other layouts from that template also? (layout names S1, S2, S3 etc up to S9) I tried throwing in an extra layout name to see if it would work by doing it like:

....../A4 DETAILS.dwt" "S1, S2")

but it only imports S1

Or if it cant be amended does anyone know of anything else?

I've found lee macs "steal" lisp which is also excellent, but it does a little more than what I need..

Specifying which layouts isn't required really (unless they need to be specified for it to work of course), just want it to import all if possible

 

(defun c:S1 ()
(setvar "cmdecho" 0)
(command "-layout" "template" "Z:/Engineering/00 LIBRARY/Drafting Resources/_Launchers/A4 DETAILS.dwt" "S1")
(setvar "cmdecho" 1)
(princ)
)

Posted

Hi,

 

Try to iterate through a list and I think it should work. eg:

(setvar "cmdecho" 0)
(foreach layout '("S1" "S2" "S3")
(command "-layout" "template" "Z:/Engineering/00 LIBRARY/Drafting Resources/_Launchers/A4 DETAILS.dwt" layout)
)
(setvar "cmdecho" 1)

Posted
Hi,

 

Try to iterate through a list and I think it should work. eg:

(setvar "cmdecho" 0)
(foreach layout '("S1" "S2" "S3")
(command "-layout" "template" "Z:/Engineering/00 LIBRARY/Drafting Resources/_Launchers/A4 DETAILS.dwt" layout)
)
(setvar "cmdecho" 1)

 

Tharwat, you are a superstar.. Helped out again with exactly what I was after. Thankyou so much!

Posted
Tharwat, you are a superstar.. Helped out again with exactly what I was after. Thankyou so much!

 

You are most welcome. :thumbsup:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...