[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Macro: Freeze All Layers
Tip# 3581 By Ted Kruysman On 13-Feb-2011
4
Rated By 2 users
Categories : Layer States
Software type : AutoCAD 2011
Rename File To : No Files to download.
Freeze all of the layers not in use.

Ted Kruysman sent us a macro that he uses in a custom command to freeze layers in AutoCAD.

"I use a Freeze All command that I made up that freezes all of the layers in the drawing except the current layer in use. The macro is:

^c^c_layer;freeze;*;;
 
I also edited the icon of the freeze layer command to show two more layers from the one layer shown. I find this very useful; I don't know why AutoCAD doesn't have it in their library."

Notes from Cadalyst Tip Patrol: Macros are great. They save us time when we use certain keystrokes in commands over and over again. I have used many macros that help me to freeze or thaw different layer sets. Another good freeze layer macro would be to thaw all layers.

 

Average Rating:
4


User comments
Comment by Roebuck,Wes
Posted on 2011-02-14 13:27:49
Wouldn't this be similar to the "LAYISO" command?
Comment by Kellogg,c. Frank
Posted on 2011-02-14 14:09:57
I may not be the most savvy at programming, but I took the tip and adapted it for use in my acaddoc.lsp file, which has over 200 similarly constructed command combinations that can't be done through the acad.pgp file. I prefer the keyboard to tool buttons - the keys are always the same, and I don't have to move the mouse from where I need it. (defun C:lza ( ) (command "layer" "freeze" "*" ^) (princ "All Except Current Layer Frozen" )(princ) ) (defun C:lzx ( ) (command "layer" "thaw" "*" ^) (princ "All Layers Thawed" )(princ) ) Come to think of it now, I generally use the layer isolate command, because I can then use the un-isolate command, and return to the previous layer state.
Comment by Azbell,Nicholas
Posted on 2011-02-14 14:34:42
Use built in functions. layiso, layuniso, layerstate
Comment by ,
Posted on 2011-02-14 17:10:04
Have you ever opened someone else's (Civil) drawing and froze all the layers, made edits on current layer and then thawed them all again only to find out that there was already 89 layers frozen that you want to remain frozen that are now thawed?...this is why my macro turns layers ON and OFF. I keep the freeze and thaw layer commands for more permanent layer states and use the layer commands ON and OFF for temp layer states. Also, the newer layer commands work great, but being a creature of habit, I still use my quik key macros from my acad.lsp file.