Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Attribute reference another attribute within a block (block editor)

33 REPLIES 33
SOLVED
Reply
Message 1 of 34
yan_ken
11702 Views, 33 Replies

Attribute reference another attribute within a block (block editor)

Hi there,

 

I have been trying this a while but how do you have one attribute reference the value in another attribute of a block.

 

I am talking about one block with two attributes: DESC1 and DESC2

 

DESC2 is always going to show whatever DESC1 is, so DESC1 is the one that I edit at the drawing level on this block and DESC2 will update accordingly.

 

I have been searching around and some people say you can but some say you can't unless you add a dymanic block parameter in.

 

what I have been doing is in block editor:

For DESC2 under Default: Insert Field->Object (Select DESC1)>Value(No format)

But after I save the block, insert the block at the drawing level, change the DESC1 value, my DESC2 is "----"

 

Thank you,

Ken

 

33 REPLIES 33
Message 2 of 34
john.vellek
in reply to: yan_ken

Hi @yan_ken,

 

I am a little confused on why you would need this kind of function. At any rate, in a normal block I have never been able to get this to work as the first field is assigned the value at the time of creation and never gets updated. Is there a reason not to just place a field outside of the block that captures the appropriate attribute value?

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 3 of 34
murray-clack
in reply to: john.vellek

You can use a FIELD in the second attribute which references the first attribute in the block

 

  1. Within the second attribute value, either press Ctrl-F on your keyboard, or, right-click and select "Insert Field"

  2. When the FIELD dialog box comes up, click on the "Field Category" pull-down menu and select "Objects"

  3. In the "Field Names" pane, click on "Object"

  4. In the "Object Type" pane, click on the cursor icon button

  5. When prompted to "Select Objects", click on the desired block

  6. When the FIELD dialog box reappears, look for the attribute value you want to duplicate in the "Object Type" pane and click "OK"

  7. You will see the duplicated value in the second attribute line of the block, and then click OK to exist the attribute editor.

    When you change the value of the first attribute, the second attribute will reflect the first attribute value after you REGEN

 

 

Message 4 of 34
john.vellek
in reply to: murray-clack

Hi @murray-clack,

 

This doesn't work for me. Once it has the value of the first attribute it will not adjust even with a Regen or Regenall.

 

If I keep the 2nd Field outside of the block then yes I can select the block and then the Attribute whose value I want to duplicate. I think the OP wants the attributes in the same block.

 

Let me know if I am misunderstanding your suggestion.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 5 of 34
yan_ken
in reply to: john.vellek

That's correct. I need the attribute reference within the same block.

Message 6 of 34
murray-clack
in reply to: yan_ken

Here is a sample of what I am talking about

Message 7 of 34
yan_ken
in reply to: murray-clack

I understand that block to block attribute reference is not an issue.

 

The issue is whether I can reference attribute within a block.

 

Thanks

Message 8 of 34
ВeekeeCZ
in reply to: yan_ken

The field can be in attribute within the same block, but you need to create the field after the block insertion into a drawing. But... probably that's not what the OP wants.

 

See what we did lately, HERE

Message 9 of 34
john.vellek
in reply to: yan_ken

Hi @yan_ken,

 

This is a new trick for me and I think it is pretty cool. Congrats to @ВeekeeCZ and @murray-clack

 

I am still not sure why I would ever need this but it is very slick. 

 

I made a Screencast demonstrating what they suggested:

 

Create two normal attributes, and then make them into a block. Once this block is inserted in the drawing, replace one of the attributes  with a field pointing to the Object:BLock - with the attribute name you want to duplicate.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 10 of 34
murray-clack
in reply to: john.vellek

Thanks for the KUDOS!

 

I can see it being used in a dual section arrow scenario.  Let's say you had a dynamic block with TWO section arrows, and obviously they would have the same value (e.g. "/A\ /A\"), so instead of having to enter the same value twice, you'd just have to do it once.

 

It's a tiny time saver, but still a time saver.

 

 

Another idea could be for title-blocks where one attribute could be for a sheet number, and that attribute could be used for another attribute within a sheet range

 

example:

Drawing 1

(Sheet 1 of 10) 


where the value "1" only has to be entered ONCE

Message 11 of 34
john.vellek
in reply to: murray-clack

Hi @murray-clack,

 

Ok  - Ok

 

I'm in! 


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 12 of 34
yan_ken
in reply to: john.vellek

Thanks John for your effort in showing me that. Smiley Wink

 

I agree that is one method, however this need to be done after the block has been created.

 

The vision I have is that the field reference is already built in so we do not need to insert field upon block insertion.

 

 

Message 13 of 34
john.vellek
in reply to: yan_ken

Hi @yan_ken,

 

I haven't explored all the possibilities but a copy paste from drawing to drawing works with this method.  It could also be part of a template to get it into a drawing.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 14 of 34
murray-clack
in reply to: john.vellek

And the other cool part is that you insert the field once, and then simply copy the block over and over again within the drawing and the field code retains within each copied block.  All you have to do next - which would have to do anyway - is modify each DESC1 value for each individual block

Message 15 of 34
rculp
in reply to: murray-clack

Like this one:

 

(insert it, don't open it)

 

 

 

 

But hey, that's just me.

Randall Culp
Civil-Structural Design Technician
(aka CADaver)
Message 16 of 34
john.vellek
in reply to: yan_ken

Hi @yan_ken,

 

I am checking back to see if my post or others helped you with your problem. Randall indicates in Post 9 that his method allows you to insert the block too.

 

Please add a post with how you decide to proceed and your results so other Community members may benefit.
Please hit the Accept as Solution button if a post or posts solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 17 of 34
rculp
in reply to: john.vellek

Place the FIELD in the attribute definition and it works fine.

But hey, that's just me.

Randall Culp
Civil-Structural Design Technician
(aka CADaver)
Message 18 of 34
yan_ken
in reply to: rculp

Thanks Randall. I think the dynamic feature has something to do with making it work. I'll look into your dwg attachment abit more. This is definitely promising!

Message 19 of 34
ВeekeeCZ
in reply to: rculp

Nice touch!

 

It took me a little while to figure this out! It must be a dynamic block!

 

When you insert a block into a drawing and don't change any of dynamic feature (= its block reference), then it does not work. But if you change any dynamic feature, then the block became an anonymous (= block definition) - and here we go, attributes works!

Message 20 of 34
yan_ken
in reply to: ВeekeeCZ

so what are the steps to create such reference using dynamic parameters? Am I just going select one of any of the dynamic parameter sets? to keep it simple, select Point Move?

 

1) Add Attribute 1 (Source)

2) Add Attribute 2 (Default Field referencing Attribute 1 Object Value)

3) Add a dynamic parameter set

 

Please correct me if I'm wrong.

 

Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost