LEADING SPACES IN TEXT

I tried it but it gives -too few arguments-, is it a command if so shouldn't it be (defun C:ss-vla-lst...)
 
works perfectly, thanks
martin

Luis Esquivel said:
Sorry, here is as a command: LS-TEXT

Just save the following as LS-TEXT.LSP

---cut here---

;;; 2:28 PM 8/14/2003 LE

(defun ss-vla-lst (ss / i vla_lst)
(setq i (if ss
(1- (sslength ss))
-1))
(while (>= i 0)
(setq vla_lst (cons (vlax-ename->vla-object
(ssname ss i))
vla_lst)
i (1- i)))
vla_lst)

(defun C:LS-TEXT (/ ss)
(vl-load-com)

(if (setq ss (ssget "_x" '((0 . "TEXT"))))
(mapcar
(function
(lambda (obj / str)
(setq str (vla-get-textstring obj))
(if (or (substr str 1 1)
(substr str (strlen str)))
(vla-put-textstring obj (vl-string-trim " " str)))))
(ss-vla-lst ss)))
(princ))

(princ)

---cut here---
 

Latest threads

Back
Top