- ;;e=ename; st1=前缀;st2=后缀.
- (defun prestr (e st1 st2 / obj str)
- (setq obj (vlax-ename->vla-object e)
- str (strcat st1 (vla-get-textstring obj) st2))
- (vla-put-textstring obj str)
- )
- ;; pst = 文字加前后缀.---------------------无痕即兴 2004.8
- (defun c:pst ( / ss st1 st2 i e)
- (princ "\n选择加前后缀的文字:")
- (setq ss (ssget '((0 . "TEXT")))
- st1(getstring "\n前缀<"">:")
- st2(getstring "\n后缀<"">:")
- i -1)
- (if (not st1)(setq st1 ""))
- (if (not st2)(setq st2 ""))
- (if ss
- (while (setq e(ssname ss (setq i(1+ i))))
- (prestr e st1 st2)
- )
- )(princ)
- )
|