Author Topic: B. I will periodically check drawings for null text.  (Read 7471 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
B. I will periodically check drawings for null text.
« on: June 27, 2004, 12:01:02 PM »
Not a standard per se but practical advice.

Null text is that text that is an empty string, or nothing but "white" characters -- tabs, spaces etc. It can exist in drawings because some [explitive deleted] operators "delete" text by bring it up in the editor and leaning on the space bar. While it sounds bogus I have seen it happen for years and it never ceases to amaze / annoy me, with extreme cases exceeding 70,000 null text entities! I wish I were joking! Symptoms are slow loading given content, zoom extends that do not make sense etc.

Quick test: Turn QTEXT on and then do a zoom extends; each space or layout tab. Little freaking boxes all over the place!

Thoughts?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Dent Cermak

  • Guest
B. I will periodically check drawings for null text.
« Reply #1 on: June 27, 2004, 12:11:52 PM »
Remove the space bar ?

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
B. I will periodically check drawings for null text.
« Reply #2 on: June 27, 2004, 12:25:00 PM »
Yes, this is a real problem.

People think the only way to remove text is to put in blank spaces.
Too bad for them  it's easier and faster to "erase" them.

I'm with you on this one Mike.
I drink beer and I know things....

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
B. I will periodically check drawings for null text.
« Reply #3 on: June 27, 2004, 04:38:14 PM »
I have a housekeeping routine that checks all drawings for me automatically when I open the drawings, if it finds them it remove them....It finds such things as :

""
" " (regardless of length)
"%%u" (i have seen this one so many times I want to kill the stupid [explitive deleted] operators that put them there....
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

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
B. I will periodically check drawings for null text.
« Reply #4 on: June 27, 2004, 06:47:20 PM »
If I my ask could I have a copy of you routine, Keith?
I drink beer and I know things....

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
B. I will periodically check drawings for null text.
« Reply #5 on: June 27, 2004, 07:09:49 PM »
I coded this blind, but it should work (or be within an edit) ...

Code: [Select]
(defun c:PurgeNullText ( / ss i )
    (if
        (setq ss
            (ssget "x"
               '(   (0 . "text")
                    (1 . ", ,%%u,%%U")
                )
            )
        )
        (repeat (setq i (sslength ss))
            (entdel (ssname ss (setq i (1- i))))
        )
    )    
    (princ)
)

<Unlock your layers first.> ;)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
B. I will periodically check drawings for null text.
« Reply #6 on: June 27, 2004, 09:28:06 PM »
That is pretty dadburned close there MP
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

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
B. I will periodically check drawings for null text.
« Reply #7 on: June 29, 2004, 02:39:39 AM »
Quote from: Keith
That is pretty dadburned close there MP

Thanks Keith (I guess I should determine if it actually works eh?). :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

hudster

  • Gator
  • Posts: 2848
B. I will periodically check drawings for null text.
« Reply #8 on: June 29, 2004, 03:51:59 AM »
I downloaded the delnul lisp that CAB posted here previously and added it to a user macro including CDGPURGE as well.

now all I have to do is click and I can purge all null entities, audit and purge my drawing all in one go.

Code: [Select]
^C^C(load "delnul.lsp");delnul;-cdgpurge;all;audit;y;-purge;all;*;no;

I tend to do this before I save my work.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

M-dub

  • Guest
B. I will periodically check drawings for null text.
« Reply #9 on: June 29, 2004, 07:58:42 AM »
I have DELNUL in my startup suite and it cleans every drawing I open.  This has been a problem for a LONG time.  It's amazing how many null entities are in some of these drawings!  I've seen a few with anywhere from 300 - 500!!!  They're pretty old drawings and they're at something like REV 59 or so, but still?!? :roll: :evil:

Code: [Select]
;; 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)

jwisherd

  • Guest
B. I will periodically check drawings for null text.
« Reply #10 on: September 23, 2004, 12:45:00 PM »
A method I use that works well,
Turn on all layers and make sure all layers are thawed.
zoom to extents
Erase all, but before finishing the erase command, remove, and select a window that covers the whole area of the drawing.
This deletes all null text entrys.