안녕하세요
lisp 고수님들께 질문 드립니다.
아래는 layer 동결 관련 리습인데요, dg 명령어를 치면 한개 layer만 선택해서 끌수 있는데,
두개 이상 선택해서 끌수 있게 변경이 가능한가요?
리습에 너무 무지 하여, 질문 드리오니 고견 부탁 드립니다.
(defun C:dg (/ f cla cl b c tla e n ss typ el eel fla)
(princ “nSelect objects to freeze layer…”)
(setq a (ssget))
(setq cl (getvar “clayer”))
(if a (progn
(setq b (sslength a))
(setq c 0)
(while (<= 1 b )
(setq a (cdr (assoc 8(entget (ssname a c )))))
(if (> c 0)
(setq fla (strcat fla (strcat “,” a))) ;Freeze layer
)
(if (= c 0)
(setq fla a)
)
(setq b (- b 1))
(setq c (+ c 1))
)
(command “LAYER” “f” fla “”)
(if (= cl fla)
(command “LAYER” “s” “0” “f” fla “”)
)
))
(if (= a nil) (progn
(prompt ” Enter layer names to freeze : “)
(setq e (getstring))
(command “LAYER” “f” e “”)
))
)
공유
감사합니다~^^