(defun c:rnb (/ en ent ety ena enn) (princ "\nFishLISP C:RNB v1.0.") (if (setq en (entsel "\n选取要改名的图块:")) (if en (progn (setq ent (entget (car en)) ety (cdr (assoc 0 ent)) ) (if (= ety "INSERT") (progn (setq ena (cdr (assoc 2 ent))) (setq loop t) (while loop (princ "\n图块名称:<") (princ ena) (setq enn (getstring 1 "> ")) (if (member enn (list "" " " ena)) (setq loop nil enn ena) (if (tblsearch "block" enn) (princ "\n已经存在此名称的图块。") (setq loop nil) ); if exist? ); if no change? ); while (setvar "cmdecho" 0) (command "rename" "block" ena enn) (setvar "cmdecho" 1) ); progn =INSERT (princ "\n对象不是图块。") );if INSERT? ); progn en ); if en? ); if picked (princ))(princ)
(defun c:rnb (/ en ent ety ena enn)
(princ "\nFishLISP C:RNB v1.0.") (if (setq en (entsel "\n选取要改名的图块:")) (if en (progn (setq ent (entget (car en)) ety (cdr (assoc 0 ent)) ) (if (= ety "INSERT") (progn (setq ena (cdr (assoc 2 ent))) (setq loop t) (while loop (princ "\n图块名称:<") (princ ena) (setq enn (getstring 1 "> ")) (if (member enn (list "" " " ena)) (setq loop nil enn ena) (if (tblsearch "block" enn) (princ "\n已经存在此名称的图块。") (setq loop nil) ); if exist? ); if no change? ); while (setvar "cmdecho" 0) (command "rename" "block" ena enn) (setvar "cmdecho" 1) ); progn =INSERT (princ "\n对象不是图块。") );if INSERT? ); progn en ); if en? ); if picked (princ))
(princ)
張貼留言
沒有留言:
張貼留言