Author Topic: Text is Null  (Read 2419 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Text is Null
« on: August 18, 2008, 03:20:34 PM »
Is there any property or telltale way to know if you ahve null text in your drawing?  The only thing I can think of is if the contents contain a space only, as in " "

Any other ideas of how to find stupidity running rampant in the office?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Text is Null
« Reply #1 on: August 18, 2008, 03:28:07 PM »
(ssget "x" '((0 . "TEXT")(1 . ""))
(ssget "x" '((0 . "TEXT")(1 . " "))
(ssget "x" '((0 . "TEXT")(1 . "  ")) 'to infinity and beyond

or you could turn on qtext and regen ... "null" text should show up as points in the drawing
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.
Re: Text is Null
« Reply #2 on: August 18, 2008, 03:39:39 PM »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Atook

  • Swamp Rat
  • Posts: 1030
  • AKA Tim
Re: Text is Null
« Reply #3 on: August 18, 2008, 04:14:55 PM »
maybe something along the lines of:

if len(Trim(objtext.textstring))=0 then
 ' fight for whirled peas
end if

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Text is Null
« Reply #4 on: August 18, 2008, 04:41:05 PM »
Thank you to all three!!! I used a combined versioin of what you guys posted and it works great
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

rogue

  • Guest
Split peas? or Splitting hairs?
« Reply #5 on: August 19, 2008, 12:35:25 PM »
If any of you have done database programming, you might remember there is a difference between an empty string ("") and a NULL one.
And I believe any other string that contains 1-to-many space characters (Chr(32)) isnt Null, or an empty string.

One of the ways to check for Nulls is to read the variables in as variants, and check for IsNull. And then, if it is, add an empty string to it ("") to convert to string.


Glenn R

  • Guest
Re: Text is Null
« Reply #6 on: August 19, 2008, 03:56:03 PM »
Whilst that would be true for an RDBMS, which AutoCAD is NOT, a simpler idea might be to use regular expressions...