 - (defun c:tt(/ ss add en txt enl num)
- (while(not (setq add (getint "\n同一加减数值:"))))
- (princ "\n选择文字:")
- (while (setq ss (ssget '((-4 . "<or")(-4 . "<and")(0 . "text") (1 . "#*")(-4 . "and>")(-4 . "<and")(0 . "text") (1 . "-#*")(-4 . "and>")(-4 . "or>"))))
-
- (repeat (setq n (sslength ss))
- (setq en (ssname ss (setq n (1- n))))
- (setq txt (cdr (assoc 1 (setq enl (entget en)))))
- (setq num (atoi txt)
- txt (substr txt (1+ (strlen (itoa num))))
- num (+ num add)
- txt (strcat (itoa num) txt)
- enl (subst (cons 1 txt) (assoc 1 enl) enl)
- )
- (entmod enl)
- )
- )
- )
|