Elektrik Posted March 20, 2023 Share Posted March 20, 2023 (edited) I want a lips to lock the layer A_arc and turn its color to 255 the first time prompted, then unlock it and turn the color to 255 prompted again. The code below change the color, but the layer stays locked each time. Thanks in advance. (defun c:qr (/ lyr) (setq lyr (tblsearch "layer" "A_arc")) (if (= (cdr (assoc 62 lyr)) 255) (progn (command "-layer" "c" "252" "A_arc" "") (command "-layer" "lock" "off" "A_arc" "") ; Unlock ) (progn (command "-layer" "c" "255" "A_arc" "") (command "-layer" "lock" "on" "A_arc" "") ; Lock ) ) (princ) ) Edited March 21, 2023 by SLW210 Please use Code Tags!! Quote Link to comment Share on other sites More sharing options...
jonathann3891 Posted March 20, 2023 Share Posted March 20, 2023 Try this out. It's helpful to type out commands to make sure you have the correct sequence. (defun c:qr (/ lyr) (setq lyr (tblsearch "layer" "A_arc")) (if (= (cdr (assoc 62 lyr)) 255) (progn (command "-layer" "c" "252" "A_arc" "") (command "-layer" "unlock" "A_arc" "") ; Unlock ) (progn (command "-layer" "c" "255" "A_arc" "") (command "-layer" "lock" "A_arc" "") ; Lock ) ) (princ) ) 1 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.