Attribute data

Discussion in 'AutoCAD' started by iwafb, May 17, 2004.

  1. iwafb

    Doug Broad Guest

    John,
    I tried to explain before that ADT is different from AutoCAD.
    Most folks here have only AutoCAD and understand only Blocks
    and attributes. The methods that work with Blocks and Attributes
    will not work with your drawing. What you have are MvBlocks.
    The MvBlocks have no attributes as most here would understand
    them. What you see in an Mvblock is derived from the display
    configuration, from viewblocks, and from its anchor. It uses a
    viewblock that contains attributes but those attributes are merely
    placeholders for information automatically inserted into them.

    MvBlocks inherit their properties from the Property Sets attached
    to the objects that the MvBlocks are anchored to. While you can
    extract the data with LISP as I showed you before, you should not try to
    change the values with LISP. The values in the entity data are only
    copies of the real data attached to the space object and residing
    in a dictionary.

    It was not my intent to make you feel inadequate or unintelligent
    in the "I spent my brain" thread. If that's how I came across, I
    apologize. It's just that accessing and controlling ADT objects
    with LISP is beyond the capabilities of most of us, no matter
    how advanced. That includes me.

    Since there is no documentation on the DXF codes of ADT
    objects and since the ADT programmers themselves have
    deliberately and publicly discouraged attempts at customization
    of ADT with LISP, we should take the hint.

    In the future, to be fair to all the generous folks that want to help,
    you should indicate in the subject thread that you want to manipulate
    ADT entities and tell them enough about them that they aren't
    confused and misled.

    Any further questions should be posted to the
    aec.arch-desktop.customization newsgroup IMO.

    Regards,
    Doug
     
    Doug Broad, May 17, 2004
    #21
  2. Try These.
    Block-ent is a block name
    TagString & TextString are self explanitary

    ;;-------------------------------------------
    (defun mm-get-entity-att-value (Block-Ent TagString / cnt
    Block-Obj Attribute space
    Attribute-List Attribute-Value
    )
    (if (vlax-property-available-p (vlax-ename->vla-object Block-Ent) 'Name)
    (setq Block-Obj (vlax-ename->vla-object Block-Ent)
    ) ;_ end of setq
    ) ;_ end of if
    (setq cnt 0
    Attribute-List
    (vlax-safearray->list (vlax-variant-value (vla-getattributes Block-Obj)))
    ) ;_ end of setq
    (while (and
    (not Attribute-Value)
    (< cnt (length Attribute-List))
    ) ;_ end of and
    (if
    (= TagString (vla-get-TagString (nth cnt Attribute-List)))
    (setq Attribute-Value (vla-get-TextString (nth cnt Attribute-List)))
    (setq cnt (1+ cnt))
    ) ;_ end of if
    ) ;_ end of while
    Attribute-Value
    ) ;_ end of defun
    ;;--------------------------------------------------------------------------
    ---------------------

    (defun mm-put-entity-att-value
    (Block-Ent TagString Textstring / Block-Set Block-Entity Block-Next
    cnt)
    (setq
    Attribute-list (vlax-safearray->list
    (vlax-variant-value (vla-getattributes (vlax-ename->vla-object
    Block-Ent)))
    ) ;_ end of vlax-safearray->list
    ) ;_ end of setq
    (foreach Attribute Attribute-List
    (if
    (= TagString (vla-get-TagString Attribute))
    (setq Attribute-Value (vla-put-TextString Attribute Textstring))
    )
    )
    )
    particular entity within an attribute (drawing block) and ammend the value
    if needed.
    (the default in the block) and dotted pair 2 returns "A" (the tag in the
    block). No matter how I revise the block (dda or eattedit) it still returns
    the same values. Is there a way of returning what the actual "text" value is
    in the drawing? I am using 2002.
     
    Greg McLandsborough, May 18, 2004
    #22
  3. iwafb

    iwafb Guest

    Thanks all, got a lot of useful info.

    I was in fact looking at the block definition, not insert.

    Also, I left out the fact I was creating a selection set using (tblsearch "block" "drgtit"). The idea was to automatically select the one block across several drawings. But will now try with:
    (setq ss(ssget"x"(list(cons 0 "INSERT")(cons 2 "DRGTIT"))))

    Where DRGTIT is the actual name of the block.

    John
     
    iwafb, May 18, 2004
    #23
  4. iwafb

    John Guest

    Doug Broad.

    Thanks for your help.

    I thought maybe there is a function to get room # as it was very easy get
    room name. Anyway I didn't waste the time because learned other functions..

    John
     
    John, May 19, 2004
    #24
  5. iwafb

    ECCAD Guest

    Doug,
    For my 2 cents..Thanks for the education on ADT. I thought it would 'behave' like normal ACAD..I'll not tend to go there and appear ignorant...
    Again, Doug - thanks.

    Bob Shaw
     
    ECCAD, May 19, 2004
    #25
  6. iwafb

    Doug Broad Guest

    John,

    John,

    Good luck in trying to make it work for you. The folks
    that track the ADT customization certainly know more
    than I do and they might have more input. Who knows?
    They might even have a LISP answer that they will share.
    Ask your question again over there to get more info.

    You're right. Asking questions is never a waste of
    time. Sorry if I made it sound that way.

    Before you look to customization of ADT as the answer,
    be sure that you are aware of how ADT itself can help
    you make the changes you want. I have been studying
    hard for almost a year and a half and am only just getting
    comfortable with it but I wouldn't say the I've explored
    all its features. ADT 2005 alone added a bunch of new
    features.

    Regards,
    Doug
     
    Doug Broad, May 19, 2004
    #26
  7. iwafb

    Doug Broad Guest

    Bob,

    You're welcome I think. BTW we're all ignorant. ;-)

    If you use ADT, don't be afraid of it. There are
    developer help files that cover the methods and properties
    of most of the ADT objects. There is very limited access
    to ADT objects with either VBA or LISP. Autodesk personel
    posting on the NG's have suggested we learn ObjectArx
    if we want to customize ADT.

    If you have a lot of time on your hands and you enjoy
    a treasure hunt, then by all means scan the entity lists
    of the ADT objects and dictionaries for their meaning.

    If on the other hand, you want to develop and sell applications
    that enhance ADT, then learn ObjectArx. That is something
    I haven't had time to learn yet.

    Regards,
    Doug
     
    Doug Broad, May 19, 2004
    #27
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.