mikekmx Posted December 12, 2014 Share Posted December 12, 2014 Hi, I'm looking to add a custom toolbar button that will thaw Layer 1, make Layer 1 current and ensure drawing colour is set to ByLayer atm i have ^C^C_-layer T "Layer 1";;^C^C_-layer _S "Layer 1";; This works OK as far as it goes but i cannot code setting the colour to ByLayer. I can't remember exactly what i have tried but have spent a good deal of time trying various combinations. EG -color _"bylayer" (I have no idea what i am doing, but am usually successfull in modifying various code for my own purposes, but it's time to ask for help on this one). Thanks. Quote Link to comment Share on other sites More sharing options...
SEANT Posted December 12, 2014 Share Posted December 12, 2014 Look at the CECOLOR system variable. Quote Link to comment Share on other sites More sharing options...
mikekmx Posted December 12, 2014 Author Share Posted December 12, 2014 Cheers Seant, ^C^C_-layer T "Layer 1";;^C^C_-layer _S "Layer 1";;^C^C;;cecolor;bylayer;;^C^C does it. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted December 12, 2014 Share Posted December 12, 2014 I moved your thread to the The CUI, Hatches, Linetypes, Scripts & Macros Forum. Please post your questions in the appropriate forum. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 13, 2014 Share Posted December 13, 2014 Dont think you need the ^c^c-layer you can keep going once you invoke -layer S lay C lay 6 T lay2 F lay3 etc Quote Link to comment Share on other sites More sharing options...
Tyke Posted December 13, 2014 Share Posted December 13, 2014 ^C^C_-layer T "Layer 1";;^C^C_-layer _S "Layer 1";;^C^C;;cecolor;bylayer;;^C^C BigAl is correct about not repeatedly calling the layer command and you only needing ^C^C at the beginning of the macro, some people are now using ^C^C^C at the beginning of their macros as apparently there are a couple of commands that need three escapes to quit them cleanly. If you are running an English language version of AutoCAD you don't need the underscores either, they are only required on non English language versions before using an English command, they just allow you use English on any AutoCAD version. You have a mixture of spaces and semicolons and they both represent a return key press, it would be cleaner to be consistent and just use on of them, I would recommend using the semicolon as you can more easily see where your returns are and when you have several returns directly after each other its easier to count semicolons than spaces. A cleaned up version of your macro would look like this: ^C^C^C-layer;T;"Layer 1";_S;"Layer 1";;cecolor;bylayer; I also deleted a couple of returns that were not necessary. Quote Link to comment Share on other sites More sharing options...
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.