See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: Field to display attribute value in same block

  1. #1
    I could stop if I wanted to jpcadconsulting347236's Avatar
    Join Date
    2011-09
    Posts
    298
    Login to Give a bone
    0

    Default Field to display attribute value in same block

    Hiya gang,

    I may have asked this before, apologies if I'm doubling up.

    Is it possible to have a field in a dynamic block that displays the current value of an attribute in that same dynamic block?

    I have a test block (attached) There is an invisible attribute which is what the user can edit by double clicking the block. The field should display that value as it's linked to the attribute "ELEVATION"

    bedit.jpg


    I have this set up and it seems to almost work. when I insert the block it displays the default value of the attribute, but if I change the attribute value, the field does not update.

    Any help is appreciated.


    -JP
    Attached Files Attached Files
    James Pertusi

    CAD Applications Consultant
    1 (646) 773 4834
    www.jpcadconsulting.com

  2. #2
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    407
    Login to Give a bone
    0

    Default Re: Field to display attribute value in same block

    I'm not understanding why the Mtext with a field to the attribute?

    Ditch the Mtext and make the attribute visible and use it in its place with EL 00.00 as the default value. Set its justification to bottom right and set it at the end of the line. Include it in the move action on Distance one and the stretch action on Distance 2

  3. #3
    I could stop if I wanted to jpcadconsulting347236's Avatar
    Join Date
    2011-09
    Posts
    298
    Login to Give a bone
    0

    Default Re: Field to display attribute value in same block

    It's a long story. And it's getting out of hand complexity wise. But at this point I really just want to know if it's possible (sort of for my own education).


    The original block had visibility states for a bunch of modifiers:

    modifiers.jpg

    The visibility state only changed the modifier text (EL, TOS, BOC, etc) so that I only needed two attributes, and you could change the modifier after you edited the attribute if you needed to.

    Now, this all worked great... until you flipped the direction of the block, at which point, because the modifier text and the attribute are two separate entities, their order is reversed:

    reversed.jpg


    So this is all being done to:


    • Keep the visibility states for the modifiers.
    • Limit the block to two editable attributes.
    • Have the visible attributes be one entity so they will maintain the proper order when flipped.



    Does that even remotely make sense?

    - - - Updated - - -

    To be honest, what we'll probably wind up using is a block with two simple attributes and the users will just type in the modifiers manually as needed...

    But now I'm in this hole and I need to know if there's a way.
    James Pertusi

    CAD Applications Consultant
    1 (646) 773 4834
    www.jpcadconsulting.com

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,659
    Login to Give a bone
    0

    Default Re: Field to display attribute value in same block

    I've wanted to do this for years, since db's came out. But it won't update. I have a wish for this you could vote for. https://www.augi.com/wish-list/rank/autocad/410410
    C:> ED WORKING....

  5. #5
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Central New Jersey
    Posts
    407
    Login to Give a bone
    0

    Default Re: Field to display attribute value in same block

    The attached block is close. It just doesn't update as I would like it to. I'd like it to update as soon as a prefix is chosen rather than requiring a regen.
    Attached Files Attached Files

  6. #6
    Member
    Join Date
    2015-12
    Posts
    2
    Login to Give a bone
    0

    Default Re: Field to display attribute value in same block

    Did you use the UPDATEFIELD command on the block after changing the value of the attribute?

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,659
    Login to Give a bone
    0

    Default Re: Field to display attribute value in same block

    Quote Originally Posted by pkenewell685935 View Post
    Did you use the UPDATEFIELD command on the block after changing the value of the attribute?
    That command doesn't work where a field references an attribute in another visual state of a db.
    C:> ED WORKING....

  8. #8
    I could stop if I wanted to USMCBody's Avatar
    Join Date
    2008-05
    Location
    Yardley, PA
    Posts
    301
    Login to Give a bone
    1

    Default Re: Field to display attribute value in same block

    So easy answer is yes it is possible, but not 100% sure if it will work the way you wanted. Here is something that I did a while back that worked, at least I do know I got it to work eventually... I made a ladder and each rung of the ladder had a height attached to it. keep on page one, and look at we get side tracked after that....

    https://forums.augi.com/showthread.p...h-arrayed-text

    The trick as I remember it (Follow the links suggestions as my memory is not 100% on this) was nesting a block within a block and then referencing that block. Possible problems for you, if you opened the block to edit it you may 'wipe that link' and and have to go in and redo the trick in the field.... I say possibly as I've had some problems with that in other blocks I made, but mostly I think because I was using formulas pretty extensively on them... sorry all this is an old trick that I did and going mostly on my memory here in this post. Hope that helps....
    Easy as Eating Pancakes.

    -Space: Above and Beyond

  9. #9
    Member
    Join Date
    2014-05
    Posts
    8
    Login to Give a bone
    0

    Default Re: Field to display attribute value in same block

    Without looking at the block you've posted, I would say that the reason things like this generally fail is because FIELDs require ObjectID values to exist for reference purposes. Attribute values don't have ObjectID information until the block is instantiated (inserted).

    What I have done for my needs was to use a basic object (a point or line segment) within the block (on defpoints). That can be referenced by FIELDs. The trick is to use a graphical object which can mathematically represent the attribute, and be unique to the block instance. A point will have unique X/Y/Z values. Line segments can have length which can be constrained to block geometry.

    Then, either the object's properties will suite your needs, or you will need to be very good at writing formulas to get the output you seek.

Similar Threads

  1. Replies: 8
    Last Post: 2018-11-19, 06:05 AM
  2. Replies: 0
    Last Post: 2013-07-26, 11:11 AM
  3. Replies: 7
    Last Post: 2012-10-17, 08:47 PM
  4. Copy previous Block Attribute Value to next Block Attribute
    By CADfunk MC in forum VBA/COM Interop
    Replies: 8
    Last Post: 2009-02-27, 09:46 PM
  5. Linking a field to an attribute value in a Dynamic Block
    By alaskahick in forum AutoCAD Fields
    Replies: 1
    Last Post: 2007-01-17, 10:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •