Jump to content

removing spaces from text in multiple drawings


naren

Recommended Posts

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)

)

___

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...