Hi Folks,
I need a macro to toggle a single layer on and off (or freeze/thaw). At the moment I'm using the freeze layer button, but when I want to thaw it I find I need to go into the Layer command and scroll down the list to thaw it. It's the layer we keep our viewports on. And I need to turn it on and off quite frequently.
Any help would be greatly appreciated
Rhoscadman
Solved! Go to Solution.
Solved by pendean. Go to Solution.
I do such with several Layers but use two buttons. One for On and one for Off for each Layer
The Toggle has been asked here before but I do not think anyone has solved it... Yet.
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
Or you could use layer lock with a transparency setting about 75%
Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Actually I DO know about layer NOPLOT and always activate it in case I forget to leave that layer thawed. But the real reason I need this is because with the numerous viewports we have on each layout and the constant need to shuffle the viewports around the layout I find I'm constantly freezing and thawing vports. When you've done 6-7 times an hr it does get a bit tedious having to oper the layer window to thaw a layer hidden amongst 120+ other layers. It would be much more convenient to have an ON/OFF toggle for that, or any other layer.
Call me lazy, but hey if the hat fits......
^C^C-la;Off;Detail;^C
^C^C-la;On;Detail;^C
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
I'm just turning Off/On Layers that I use for Construction lines and background noise in Modelspace to clear things up from time to time. These couple are no-plots and Frozen in Viewports already if left on.
Regards, Charles Shade
CSHADEDESIGN | AUTOCAD LT | LT-KB | DYNAMIC BLOCKS
Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
..or you could use layer states manager.
but then it's not just a one click deal
Thanks Dean, it's almost there, but for some reason the layer won't stay ON or OFF. I'll give it another go at my lunch hour to see if I can tweak it.
Cheers
Rhoscadman
Sorry Dean, but I'm at a loss as to where the bracket should go; I can find 3 open brackets but only 2 closing ones. I'm almost ther inasmuch I can freeze the layer, but cannot then thaw it.
much appreciated
Sorry Dean, tried every which way with your macro, even tried the ON/OFF toggle described here:
But it just kept taking me back to the CUI Manager for some obscure reason. So, to cut a long story short I just gave up and went the easy option of creating 2 separate buttons one for ON and another for OFF. If you do come across a macro that would work, let me know as I'd be very interested.
Thanks for your help
Can you post the macro you are using (that is opening the CUI) and what is happening on the command line?
The toggle I proposed on the other thread (the accepted solution) was for a group of layers. Insert your layer for <layername>:
^C^Csetenv;layf-t;\$M=$(if,$(=,$(getenv,layf-t),0),_-Layer;Thaw;<layername>;;,_-Layer;Freeze;<layername>;;)
Or if you want to try the "true" toggle I posted there is one step to set it up. Type this into the command line while your layers are thawed (environment variables are case sensitive).
SETENV layf-t 1
And this is the macro code for the toggle:
^C^C$M=$(if,$(=,$(getenv,layf-t),0),setenv;layf-t;1;_-Layer;Thaw;<layername>;;,setenv;layf-t;0;_-Layer;Freeze;<layername>;;)^Z
(if ("mysolution"=answer) then (click "Accept As Solution"))
Hello Brandon,
Here is the macro I copied and pastred from your earlier thread to the CUI tool.
^C^C$M=$(if,$(=,$(getenv,layf-t),0),setenv;layf-t;1;_-Layer;Thaw;<layername>;;,setenv;layf-t;0;_-Layer;Freeze;<layername>;;)^Z
I mistakenly thought it opened the CUI, but no, all it does is repeat the previous command.
I have attached a screen shot of the commanlines when I invoke the toggle macro
Cheers
Can't find what you're looking for? Ask the community or share your knowledge.