- (defun c:tt ()
- "相同文字进行编号"
- (defun dxf (code e) (cdr (assoc code (entget e))))
- (defun SubUpd(e c v)(entmod(subst(cons c v)(assoc c(entget e))(entget e)))(entupd e))
- (if (and (setq s1 (car (entsel "\n选择参照文本: ")))
- (setq tx (DXF 1 s1))
- (setq ss (ssget "X" (list '(0 . "text") (cons 1 tx))))
- (setq i -1)
- )
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq tx1 (strcat tx "-" (itoa (1+ i)))
- s1 (SubUpd s1 1 tx1)
- )
- )
- )
- (princ)
- )
|