Searching for "empty" text strings

Discussion in 'AutoCAD' started by Lunt, Aug 11, 2004.

  1. Lunt

    Lunt Guest

    I am coding an app the will initially search and delete "empty" text strings on a specific layer....any suggestions..should I use DXF group codes?
     
    Lunt, Aug 11, 2004
    #1
  2. Lunt

    T.Willey Guest

    Search this NG, there has been some talk about this, and some programs have been written.

    Tim
     
    T.Willey, Aug 11, 2004
    #2
  3. (setq ss (ssget "X" (list (cons 0 "*TEXT") (cons -4 "<OR") (cons 1 "") (cons
    1 " ") (cons 1 " ") (cons -4 "OR>"))))

    will find all text or mtext with blank, 1 space or 2 spaces in the text.
     
    Alan Henderson @ A'cad Solutions, Aug 11, 2004
    #3
  4. Lunt

    R.K. McSwain Guest


    Something like this...

    (SSGET "X" '((0 . "TEXT")(8 . "0")(-4 . "<OR")(1 . " ")(1 . "")(-4 . "OR>")))

    will find all empty text strings on layer "0".
     
    R.K. McSwain, Aug 11, 2004
    #4
  5. Lunt

    R.K. McSwain Guest

    You actually only need (1 . "") and (1 . " ")
    It will find all empty strings, no matter how many spaces.
     
    R.K. McSwain, Aug 12, 2004
    #5
  6. You could even condense that a little

    (ssget "x" '((0 . "MTEXT,TEXT") (1 . ", ")))

    PS: Thanks again, John.
     
    Jason Piercey, Aug 12, 2004
    #6
  7. even shorter
    (ssget "x" '((0 . "*TEXT") (1 . ", ")))
     
    Alan Henderson @ A'cad Solutions, Aug 12, 2004
    #7
  8. That is fine if you can be sure there will no chance of a
    custom text object. I prefer not to make that assumption.
     
    Jason Piercey, Aug 12, 2004
    #8
  9. Lunt

    John Uhden Guest

    That should be "Thanks, Steve." But watch out. Any MTEXT that has any
    formatting embedded will be excluded. The version of KILLDOTS included free in
    my evaluation versions (CVR15.EXE + CVR16.EXE) will filter through all the mtext
    and see if the unformatted string matches ", ". I'm pretty sure that KILLDOTS
    and a few others will keep working after the evaluation period has expired. I
    do need to upgrade it to interpret tabs.
     
    John Uhden, Aug 12, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.