也许这
- ;; CAB 04/10/2006
- ;; Add space(s) to text strings between characters
- ;; Note that there are problems with format codes especially with mText.
- (defun c:textspacer (/ spc ent txt obj spacetext)
- (defun spacetext (txtstring spccnt / spaces newlst)
- (repeat spccnt (setq spaces (cons 32 spaces)))
- (foreach x (vl-string->list txtstring)
- (setq newlst (append newlst (list x) spaces))
- )
- (vl-list->string newlst)
- )
-
- (initget 6)
- (setq spc (getint "\nHow many spaces do you want to add? 1-5 "))
- (or spc (setq spc 1))
- (if (> spc 5) (setq spc 5))
- (while (setq ent (entsel "\nSelect Text to add spaces to."))
- (setq txt (vla-get-textstring (setq obj (vlax-ename->vla-object (car ent)))))
- (setq txt (spacetext txt spc))
- (vla-put-textstring obj txt)
- )
- (princ)
- )
|