EYNLLIB Posted September 15, 2023 Posted September 15, 2023 (defun c:DC ( / curlay) (setq curlay (getvar "CLAYER")) (command "_.layer" "_set" "S - DETAIL CUT" "" "_.insert" "Detail Cut" "_scale" 36 "_.layer" "_set" curlay "" ) ) After the block is inserted on the proper layer per the code, the layer is not being reset properly to the previous current layer. Any help would be appreciated, I'm still learning lisp Quote
rkmcswain Posted September 16, 2023 Posted September 16, 2023 Give this a try: (defun c:DC ( / curlay) (setq curlay (getvar "CLAYER")) (setvar "clayer" "S - DETAIL CUT") (vl-cmdf "._insert" "Detail Cut" "_s" 36.0 "_r" 0) (setvar "clayer" curlay) (princ) ) 2 Quote
EYNLLIB Posted September 20, 2023 Author Posted September 20, 2023 On 9/16/2023 at 12:40 PM, rkmcswain said: Give this a try: (defun c:DC ( / curlay) (setq curlay (getvar "CLAYER")) (setvar "clayer" "S - DETAIL CUT") (vl-cmdf "._insert" "Detail Cut" "_s" 36.0 "_r" 0) (setvar "clayer" curlay) (princ) ) I tried your solution but the layer is not reset to curlay properly. I managed to find in a fix for my code by adding a pause after the rotate. see below; (defun c:DC ( / curlay) (setvar 'cmdecho 0) (setq curlay (getvar "CLAYER")) (command "_.layer" "_set" "S - DETAIL CUT" "" "_.insert" "Detail Cut" "_scale" 36 "_rotate" 0 pause "_.layer" "_set" curlay "" ) (setvar 'cmdecho 1) (Princ) ) Quote
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.