 - (defun c:tt ()
- (if (and (setq s1 (car (entsel "\n选择源文字A(将被复制的文字): ")))
- (wcmatch (cdr (assoc 0 (entget s1))) "*TEXT")
- (setq tx (cdr (assoc 1 (entget s1))))
- )
- (while (and (setq s2 (car (entsel "\n选择目标文字B(将被替换的文字,右键结束): ")))
- (wcmatch (cdr (assoc 0 (entget s2))) "*TEXT")
- )
- (setq ent (entget s2))
- (entmod (subst (cons 1 tx) (assoc 1 ent) ent))
- (entupd s2)
- )
- )
- (princ)
- )
|