너무 많은 레이어명을 바꾸줘야 해서요. 리습 상에서 리스트를 만들어서
한번에 바꾸고 싶은데… 가능할까요?
(defun c:lc()
( ~을 ~로
~을 ~로) ;;; 이런 식으로… 제가 무식해서…ㅜㅜ
아래 검색해 보니 “nonno”님이 올려주신 레이어명 바꾸는 리습이 있긴 한데 어떻게 고쳐서 써야 하는지 모르겠어요.
(defun xx_0 (#aa / #a #b)
(foreach x (reverse(vl-string->list #aa))
(if (and(not(eq 38 x))(not #b))
(setq #a(cons x #a))
(setq #b t)
);;if
);;foreach
(apply ‘strcat(mapcar ‘chr #a))
);;defun
;;===================================
(defun c:xx (/ #ad #al)
(setq #ad(vla-get-activedocument(vlax-get-acad-object)))
(setq #al(vla-get-layers #ad))
(vlax-map-collection #al ‘(lambda(x)(vla-put-name x (xx_0(vla-get-name x)))))
(princ)
);;defun
부탁드립니다.