Martin (archive)
Usenet Archive
- Joined
- Aug 1, 2000
- Messages
- 245
- Reaction score
- 0
i wonder how to remove leading spaces with lsp for the whole drawing martin
i wonder how to remove leading spaces with lsp for the whole drawing 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---