CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.099.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
Plex.Earth connects AutoCAD and Google Earth
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closedautocad 2009 toggle between 2 layers on/off

 Post Reply Post Reply
Author
monikt View Drop Down
Newbie
Newbie


Joined: 04.Apr.2011
Location: Romania
Using: AutoCAD 2010
Status: Offline
Points: 2
Direct Link To This Post Topic: autocad 2009 toggle between 2 layers on/off
    Posted: 08.Jul.2015 at 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
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 08.Jul.2015 at 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.
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 686
Direct Link To This Post Posted: 08.Jul.2015 at 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
); if

Or:

(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].
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,133 seconds.