我也简单写了一个,方法较笨  - (defun c:ss(/ n ss ssna sslst str strnew strnew2 sslst2)
- (setq n 0)
- (if (setq ss (ssget "x" '((0 . "text") (1 . "*yz"))))
- (repeat (sslength ss)
- (setq ssna (ssname ss n))
- (setq sslst (entget ssna))
- (setq str (cdr (assoc '1 sslst)))
- (setq strnew (vl-string-right-trim "yz" str))
- (setq strnew2 (strcat "xy" strnew))
- (setq sslst2 (subst (cons 1 strnew2) (assoc '1 sslst) sslst))
- (entmod sslst2)
- (entupd ssna)
- (setq n (1+ n))
- )
- )
- (princ)
- )
- (prompt "\n程序运行命令为ss")
|