÷ºÎµÈ DCL ÆÄÀÏ ´Ù¿î ¹Þ¾Æ¼ ÇÔ²² »ç¿ëÇϼ¼¿ä
;;------ block name change ------------------------------------------
;;¸í·É¾î : BN
(defun c:bn(/ 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 "Block_name_Change_bn.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 "ÁöÁ¤µÈ ºí·ÏÀÌ ¾øÀ½...´Ù½ÃÁöÁ¤Çϼ¼¿ä")) (unload_dialog dcl_id)
(if (= ky1 9) (progn (command "rename" "b" obn nbn) (prompt "nºí·ÏÀ̸§º¯°æ:") (prin1 obn)(prompt "->") (prin1 nbn) )) );while end (prin1)) ;subroutine (defun @butt2() (if (or (tblsearch "block" nbn) (= nbn " ")) (progn (set_tile "text_new" obn)(mode_tile "text_new" 2) )) ); end of defun |