Display full version of the post: autocad 2009 toggle between 2 layers on/off

monikt
08.07.2015, 12:20
Please help if you know a macro or a lisp for freeze/unfreeze 2 specific layer - ex. layer1 frozen and layer2 unfrozen and viceversa, by one click.Thank you

John Connor
08.07.2015, 13:00
There are custom layer freeze/thaw lisps available that could easily be tweaked to be layer specific.  Find one and edit it or write one of your own.

Kent Cooper
08.07.2015, 16:00
Some ways that could be done:(if (= (logand 1 (cdr (assoc 70 (tblsearch "layer" "layer1")))) 1); layer1 is frozen  (command "_.layer" "_thaw" "layer1" "_freeze" "layer2" "" "_.regen"); then  (command "_.layer" "_thaw" "layer2" "_freeze" "layer1" "" "_.regen"); else); ifOr:(if (= (logand 1 (cdr (assoc 70 (tblsearch "layer" "layer1")))) 1); layer1 is frozen  (setq layerT "layer1" layerF "layer2"); then  (setq layerT "layer2" layerF "layer1"); else); if(command "_.layer" "_thaw" layerT "_freeze" layerF "" "_.regen")Or:(setq  layers '("layer1" "layer2")  layerT (if (= (logand 1 (cdr (assoc 70 (tblsearch "layer" "layer1")))) 1) "layer1" "layer2")); setq(command "_.layer" "_thaw" layerT "_freeze" (car (vl-remove layerT layers)) "" "_.regen")Use (defun) to put one into a command name, and have that command name invoked by a menu item [or by typing it].