这么个小程序对你来说应该不是什么难题啊,简单写了下,你自己调试再改下! - (defun c:een()
- (setq n 0)
- (if (setq ss (ssget '((0 . "text"))))
- (repeat (sslength ss)
- (setq txt-lst (entget (ssname ss n)))
- (setq txt-str (cdr (assoc '1 txt-lst)))
- (setq sec (substr txt-str (strlen txt-str)))
- (setq firs (substr txt-str '1 (- (strlen txt-str) 1)))
- (setq sec-i-str (itoa (+ (atoi sec) 1)))
- (setq txt-str (strcat firs sec-i-str))
- (setq txt-lst (subst (cons '1 txt-str) (assoc '1 txt-lst) txt-lst))
- (entmod txt-lst)
- (setq n (1+ n))
- )
- )
- (princ)
- )
|