Hi.
I'm trying to write a bit of code that steps through my layers, and if there's a match of "*EXIST", it runs the function I've written up. Else, moves on to the next.
Code:
(defun c:MICKY (/ layOld layNew ss)
(setq layOld (getvar "clayer"))
(setq layNew (strcat layOld "-OFF"))
;STEP THROUGH LAYERS
;> IF MATCH "*EXIST" THEN...
(setq ss (ssget "x" (list (cons 8 (getvar "CLAYER")))))
(command "-COPYTOLAYER" ss "" layNew "y" "0,0,0" "")
;>ELSE NEXT LAYER
)
Pretty simple function i think but I have doo-doo brain so would really appreciate any sort of help or guidance.