masterfal Posted September 15, 2016 Posted September 15, 2016 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) ) Quote
Tharwat Posted September 15, 2016 Posted September 15, 2016 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) Quote
masterfal Posted September 15, 2016 Author Posted September 15, 2016 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! Quote
Tharwat Posted September 15, 2016 Posted September 15, 2016 Tharwat, you are a superstar.. Helped out again with exactly what I was after. Thankyou so much! You are most welcome. Quote
Recommended Posts
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.