Attribute Properties

Discussion in 'AutoCAD' started by MDB, Jan 3, 2004.

  1. MDB

    MDB Guest

    Anybody know how to change the color of attribute text? When I attedit the title block I have an option in the properties to change the color of the value, but I don't have a clue where to access it.

    TIA,

    Mike
     
    MDB, Jan 3, 2004
    #1
  2. The BlockRef's GetAttributes method returns the insert's attributes in an
    array.

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | Anybody know how to change the color of attribute text? When I attedit
    the title block I have an option in the properties to change the color of
    the value, but I don't have a clue where to access it.
    |
    | TIA,
    |
    | Mike
     
    R. Robert Bell, Jan 4, 2004
    #2
  3. MDB

    Mark Propst Guest

    the title block I have an option in the properties to change the color of
    the value, but I don't have a clue where to access it.
    do you mean via code?
    If you have a reference to the attribute object you want to change, eg:
    dim objAttRef as AcadAttributeReference
    'use a selection method or iteration method or filtered selection set or ???
    to get the att ref.
    'here we assume SelectAttributeReference is a function returning a reference
    to a selected attrib ref.
    set objAttRef = SelectAttributeReference
    'assume NewColorNumber is a valid acad color number or equiv.
    objAttRef.Color = NewColorNumber

    ....is that what you mean?
     
    Mark Propst, Jan 4, 2004
    #3
  4. MDB

    MDB Guest

    Thanks for the replies guys, I jumped back online to report that I figured it out.

    objAttRef.color

    Thanks again.

    Mike
     
    MDB, Jan 4, 2004
    #4
  5. Please note that the Color property in being phased out. You should use
    TrueColor (in A2k4 and above) for future compatibility. (Search for sample
    code in this ng.)


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | Thanks for the replies guys, I jumped back online to report that I figured
    it out.
    |
    | objAttRef.color
    |
    | Thanks again.
    |
    | Mike
     
    R. Robert Bell, Jan 4, 2004
    #5
  6. If you want your code to run unmodified on pre-A2K4 and
    later, you have to use the color property. The reason it
    is still there in A2K4 is to avoid breaking a lot of existing
    code. That pretty much garantees it will be there in A2K5
    as well. Don't worry too much about AutoCAD 2007.
     
    Tony Tanzillo, Jan 4, 2004
    #6
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.