naren Posted February 9, 2017 Share Posted February 9, 2017 Hi, I got a lisp from google browsing, this lisp helps to remove spaces from text in drawing, but I got around 100 drawings where in drawing in particular layered texts contains unwanted spaces. In my drawings layer "Text" and color "green" texts contents unwanted spaces I want to remove these particular spaces using lisp, but I have only space removing lisp. can we make a lisp to modify remove spaces from particular layer and color texts in all drawings at a time. here I am placing lisp which I have got from net. (defun C:REMSPC (/ ss i elist txt n) (setq ss (ssget '((0 . "TEXT")))) (if ss (progn (setq i (1- (sslength ss))) (while (>= i 0) (setq elist (entget (ssname ss i)) txt (cdr (assoc 1 elist)) i (1- i) ) (while (= (substr txt 1 1) " ") (setq txt (substr txt 2)) ) (setq n (strlen txt)) (while (= (substr txt n 1) " ") (setq n (1- n)) ) (setq txt (substr txt 1 n)) (entmod (subst (cons 1 txt)(assoc 1 elist) elist)) ) ) (alert "No TEXT selected.") ) (princ) ) ___ Quote Link to comment Share on other sites More sharing options...
ReMark Posted February 9, 2017 Share Posted February 9, 2017 I doubt it would be possible to remove the space in all drawings at ONE time. Most likely you would have to do a batch operation possibly employing a script that would process an entire folder of drawings. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 9, 2017 Share Posted February 9, 2017 Hi, Please modify your post to add code tags READ THIS I could write the codes to remove the space in all your target drawings but unfortunately I will not write them on voluntary time. So hit this >> LINK to contact me if you'd like me to write the program for you. Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 9, 2017 Share Posted February 9, 2017 Lee posted a script writer eons ago. http://www.lee-mac.com/scriptwriter.html Load your command into your start, and call it with the script writer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.