블록이름 변경 리습 내용인데요.
전에 잘 되다가 갑자기 안되기 시작했는데 무슨 문제인지 알수가 없네요 ㅠㅠ
(defun c:bt(/ obn nbn ss ky1)
(prompt “…블록이름 변경하기”)
(setq obn nil nbn nil ss nil)
(setq ss (ssget “:s” ‘((0 . “insert”))))
(if ss (setq obn (cdr (assoc 2 (entget (ssname ss 0)))))
(setq obn “지정된 블록이 없음…다시지정하세요”))
(setq dcl_id (load_dialog “bt.dcl”))
(setq ky1 3)
(while (= ky1 3)
(if (not (new_dialog “bn_chg” dcl_id)) (exit))
(set_tile “text_old” obn)
(if (= nbn nil) (set_tile “text_new” obn)(set_tile “text_new” nbn))
(mode_tile “text_new” 2)
(action_tile “text_old” “(setq obn $value)”)
(action_tile “text_new” “(setq nbn $value)”)
(action_tile “butt1” “(setq ky1 3)(done_dialog)”)
(action_tile “butt2” “(@butt2)”)
(action_tile “accept” “(setq ky1 33)(done_dialog)”)
(action_tile “cancel” “(setq ky1 4)(done_dialog)”)
(start_dialog)
(cond
((= ky1 3)
(setq ss (ssget “:s” ‘((0 . “insert”))))
(if ss (progn
(setq obn (cdr (assoc 2 (entget (ssname ss 0)))))
(setq nbn obn))
(setq obn “지정된 블록이 없음…다시지정하세요”))
)
((= ky1 33)
(if (or (tblsearch “block” nbn) (= nbn ” “))
(setq ky1 3) (setq ky1 9))
)
)
(if (and (= (tblsearch “block” obn) nil)(/= ky1 4))
(setq ky1 3 obn “지정된 블록이 없음…다시지정하세요”))
);while end
(unload_dialog dcl_id)
(if (= ky1 9) (progn
(command “rename” “b” obn nbn)
(prompt “n블록이름변경:”) (prin1 obn)(prompt “->”) (prin1 nbn)
))
(prin1))
;subroutine
(defun @butt2()
(if (or (tblsearch “block” nbn) (= nbn ” “)) (progn
(set_tile “text_new” obn)(mode_tile “text_new” 2)
))
)
캐드 2015에는 command 함수를 command-s로 수정해야 한다고 하네요.