这样,另,给你加了个记忆小功能
- (defun C:RepB ( / ent ents Bname)
- (while (setq ent (car (entsel)))
- (progn
- (setq ents (entget ent))
- (if (not bn)
- (setq Bname (getstring "\n输入新块名:"))
- (progn
- (setq Bname (getstring (strcat "\n输入新块名<" bn ">:")))
- (if (= Bname "")
- (setq Bname bn)
- )
- )
- )
- (setq bn Bname)
- (setq ents (subst (cons 2 Bname) (assoc 2 ents) ents))
- (entmod ents)
- )
- )
- (princ)
- )
|