看看这个:
- (defun C:Rt (/ en el l n restxt dat)
- (setvar "cmdecho" 0)
- (setq en (car (entsel "please select soure text:")))
- (setq el (ssget '((0 . "*text"))))
- (setq l 0
- n (sslength el)
- )
- (setq restxt (vla-get-TextString (vlax-ename->vla-object en)))
- (while (< l n)
- (setq dat (ssname el l))
- (vla-put-TextString (vlax-ename->vla-object dat) restxt)
- (setq l (1+ l))
- )
- (princ)
- )
TO楼主:应该把某些变量高为局部变量。 |