Author Topic: Blank text remover..  (Read 2365 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Blank text remover..
« on: March 14, 2005, 10:41:56 AM »
Hi all..

I'm looking for a routine to remove any blank TEXT and MTEXT in a drawing..

any suggestions ?



 :wink:
Keep smile...

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Blank text remover..
« Reply #1 on: March 14, 2005, 11:00:01 AM »
Something along these lines perhaps.
Code: [Select]

(setq ss (ssget "x" '((0 . "TEXT")(1 . " "))))
TheSwamp.org  (serving the CAD community since 2003)

t-bear

  • Guest
Blank text remover..
« Reply #2 on: March 14, 2005, 12:09:52 PM »
Andrea....
I believe there are a number of these here.  Do a search for blank text and/or null text......that should find them.

VerticalMojo

  • Guest
Blank text remover..
« Reply #3 on: March 14, 2005, 12:17:26 PM »
T-bear...

I tried to do a search and couldn’t find any..... Maybe a different keyword? :?

hudster

  • Gator
  • Posts: 2848
Blank text remover..
« Reply #4 on: March 14, 2005, 12:28:19 PM »
try this
Code: [Select]
; Delete Null Objects
;; DelNul.lsp    
;; Deletes nul lines of Text, Mtext & Blocks.
;; Modified by JL Thomas 12/02/97  

(Defun C:DelNul ( / TXT BLK NB NAMES)
  (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)
)
(c:DelNul)
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

MikePerry

  • Guest
Blank text remover..
« Reply #5 on: March 14, 2005, 12:52:48 PM »
Quote from: VerticalMojo
I tried to do a search and couldn’t find any..... Maybe a different keyword? :?
Hi

Can someone post a copy of delnul.lsp

Have a good one, Mike

VerticalMojo

  • Guest
Blank text remover..
« Reply #6 on: March 14, 2005, 01:00:02 PM »
Mike your the search master  8)

Andrea

  • Water Moccasin
  • Posts: 2372
Blank text remover..
« Reply #7 on: March 14, 2005, 01:04:01 PM »
Hey !!  this work perfectly..

thanks all. 8)
Keep smile...

MikePerry

  • Guest
Blank text remover..
« Reply #8 on: March 14, 2005, 01:04:08 PM »
Quote from: VerticalMojo
Mike your the search master  8)
Hi "VerticalMojo"

Thanks :oops: <- your kind words have embarrassed me.

I used -

Empty AND Text

as my search criteria.

Cheers, Mike

VerticalMojo

  • Guest
Blank text remover..
« Reply #9 on: March 14, 2005, 02:49:32 PM »
Mike,

More like  :oops: myself. I should have thought of those key words!
<--- As Homer Simpson would say...... DOH!