TheSwamp
CAD Forums => CAD General => CAD Standards => Topic started by: MP 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?
-
Remove the space bar ?
-
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 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....
-
If I my ask could I have a copy of you routine, Keith?
-
I coded this blind, but it should work (or be within an edit) ...
(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.> ;)
-
That is pretty dadburned close there MP
-
That is pretty dadburned close there MP
Thanks Keith (I guess I should determine if it actually works eh?). :)
-
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.
^C^C(load "delnul.lsp");delnul;-cdgpurge;all;audit;y;-purge;all;*;no;
I tend to do this before I save my work.
-
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:
;; 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)
-
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.