Block À̸§ ¹Ù²Ù±â
¸í·É¾î : BLKREN
(defun renameblock (old new / ent) (and (= (type old) (type new) 'STR) (/= new old) (snvalid new 0) (setq ent (tblobjname "block" old)) (or ;; allow changing case of block name (= (strcase old) (strcase new)) (not (tblobjname "block" new)) ) ;_ End of or ;; then get the block record... (setq ent (cdr (assoc 330 (entget ent)))) (setq ent (entget ent)) (entmod (subst (cons 2 new) (assoc 2 ent) ent)) ) ;_ End of and ) ;_ End of defun (defun c:BLKREN ( / *New_Block_Name *Old_Block_Name *Rename_Block_Name *Select_Block_Ename *Select_Block_Obj_SSet)
(setvar "cmdecho" 0) (command "undo" "mark") (princ "n Undo-Mark µÇ¾ú½À´Ï´Ù.") (princ "n ¸í·É¾î : BLKREN - ºí·°ÀÇ À̸§À» º¯°æ") (princ "n À̸§À» º¯°æÇÒ ºí·°À» ¼±ÅÃÇϼ¼¿ä!") (setq *Select_Block_Obj_SSet (ssget ":S" (list (cons 0 "insert")))) (setq *Select_Block_Ename (ssname *Select_Block_Obj_SSet 0)) (setq *Old_Block_Name (cdr (assoc 2 (entget *Select_Block_Ename)))) (initget 7) (setq *New_Block_Name (getstring "n »õ·Î¿î ºí·°ÀÇ À̸§À» ³ÖÀ¸¼¼¿ä! : ")) (setq *Rename_Block_Name (renameblock *Old_Block_Name *New_Block_Name)) (princ "n ¸í·É¾î : chbn - ºí·°ÀÇ À̸§À» º¯°æÇÏ´Â ÄÚµå") (if (/= *Rename_Block_Name nil) (progn (princ "n") (princ " ** Block : "") (princ *Old_Block_Name) (princ ""(ÀÌ)°¡ ") (princ "--------------> "") (princ *New_Block_Name) (princ ""(À¸)·Î ºí·°À̸§ÀÌ º¯°æµÇ¾ú½À´Ï´Ù. ") ) ;_ End of progn ) ;_ End of if (princ) ) |