Set Attribute value to 'no value'

Discussion in 'AutoCAD' started by Phil Clark, Mar 3, 2005.

  1. Phil Clark

    Phil Clark Guest

    Basically, I'm trying to remove the value of an attribute.

    AttArray(1).TextString = ""
    results in:
    Run-time error:
    Invalid Input

    Note: I don't want to delete the attribute, just set the value to nothing.
     
    Phil Clark, Mar 3, 2005
    #1
  2. Phil Clark

    fantum Guest

    Is your code actually using a literal empty string or is it something else like a variable or the text property of a text box?
     
    fantum, Mar 3, 2005
    #2
  3. A bug in the ActiveX API causes this error.

    It is supposed to be applied to the TagString value,
    but is applied to the TextString value as well.

    Is this AutoCAD 2005? I've not checked in that
    release, but I'd be very dismayed if they didn't
    fix this one yet, as they've only known about it
    for about 5 years....

    The best you can do is set it to a single space.
     
    Tony Tanzillo, Mar 3, 2005
    #3
  4. Can you use ToolPac > Attribute > Strip?

    Terry
     
    Terry W. Dotson, Mar 3, 2005
    #4
  5. Phil Clark

    Phil Clark Guest

    It's from a variable taken from textbox text prop.

    like a variable or the text property of a text box?
     
    Phil Clark, Mar 4, 2005
    #5
  6. Phil Clark

    Phil Clark Guest

    ok, thanks Tony

    I noticed it in 2004, but tested 2005 and it's bugged there too
     
    Phil Clark, Mar 4, 2005
    #6
  7. Phil Clark

    fantum Guest

    If the text box is empty then the returned value for its text property is not an empty string but a null string - a string whose address is zero. The TextString property of an attribute doesn't like those. Try concatenating the text property with an empty string when assigning it to the variable.
     
    fantum, Mar 4, 2005
    #7
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.