Author Topic: blank text  (Read 3392 times)

0 Members and 1 Guest are viewing this topic.

Ron Heigh

  • Guest
blank text
« on: March 17, 2004, 12:59:54 PM »
Where would I get a routine to remove all blank text (including just spaces) in a drawing?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
blank text
« Reply #1 on: March 17, 2004, 01:08:05 PM »
Try this to get the blank text......
Code: [Select]
(ssget "x" '((1 . "")))
and for spaces ... well, you could have any number of spaces in a text entity, so it would need to be a deeper lisp than above...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Ron Heigh

  • Guest
blank text
« Reply #2 on: March 17, 2004, 02:28:30 PM »
Thanks Keith.

I took what you gave me and solved the spaces on my own.

Regards

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
blank text
« Reply #3 on: March 17, 2004, 02:47:32 PM »
Did you see this code on this thread?
 
 
Code: [Select]
;_____________________________________________________________________________  
  ;; DELETES NUL LINES OF TEXT, MTEXT, AND BLOCKS
 ;_____________________________________________________________________________

  (if (setq TXT   (ssget "X"
             '((-4 . "<and")
          (-4 . "<or")
          (0 . "MTEXT")
          (0 . "TEXT")
          (-4 . "or>")
          (-4 . "<or")
          (1 . "")
          (1 . " ")
          (1 . "  ")
          (1 . "   ")
          (1 . "{}")
          (1 . "{ }")
          (1 . "{  }")
          (1 . "{   }")
          (1 . "{}\P")
          (1 . "{ }\P")
          (1 . "{  }\P")
          (1 . "{   }\P")
          (-4 . "or>")
          (-4 . "and>")
         )
      )
      )
    (progn
      (command "_erase" TXT "")
      (princ (strcat "\n  "
           (itoa (sslength TXT))
           " nul text strings deleted. "
        )
      )
    )
    (princ "\n  No nul text strings found. ")
  )

  (setq   BLK   (tblnext "BLOCK" T)
   NAMES nil
  )
  (while BLK
    (if   (= (cdr (assoc 0 (entget (cdr (assoc -2 BLK))))) "ENDBLK")
      (progn
   (if (setq NB (ssget "X" (list (assoc 2 BLK))))
     (command "_erase" NB "")
   )
   (setq NAMES (cons (cdr (assoc 2 BLK)) NAMES))
      )
    )
    (setq BLK (tblnext "BLOCK"))
  )
  (if NAMES
    (progn (textscr)
      (princ "\n  Nul blocks found and need purging: ")
      (foreach X NAMES (princ "\n    ") (princ X))
    )
    (princ "\n  No nul blocks found. ")
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
blank text
« Reply #4 on: March 17, 2004, 10:02:21 PM »
Quote from: CAB
Did you see this code on this thread?


Actually I did not...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie