Attribute reference another attribute within a block (block editor)

Attribute reference another attribute within a block (block editor)

yan_ken
Advocate Advocate
18,205 Views
34 Replies
Message 1 of 35

Attribute reference another attribute within a block (block editor)

yan_ken
Advocate
Advocate

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

 

0 Likes
Accepted solutions (1)
18,206 Views
34 Replies
Replies (34)
Message 21 of 35

ВeekeeCZ
Consultant
Consultant
Accepted solution

@yan_ken wrote:

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


4) Add a dynamic action

 

See the SCREENCAST

0 Likes
Message 22 of 35

yan_ken
Advocate
Advocate

Thanks for all your help on this. I hope others can find this useful.

0 Likes
Message 23 of 35

yan_ken
Advocate
Advocate

I am going to push the envelope even further. 

 

Is there a way to automatically click the dynamic point upon insertion without having to manually click it?

 

For reference to update, the dynamic block just needs a nudge (click) on the dynamic point in order to wake up the attribute reference.

 

Thanks.

0 Likes
Message 24 of 35

Anonymous
Not applicable

REGEN will "bump" the reference field.  I usually don't bother until I'm ready to plot then one REGEN gets 'em all.

0 Likes
Message 25 of 35

yan_ken
Advocate
Advocate

What I meant was when the block is first inserted into the drawing, REGEN will not work until the dynamic point has been click.

 

Regen only works after you have clicked the dynamic point.

0 Likes
Message 26 of 35

Anonymous
Not applicable

Mine works just fine here without bumping the dynamic point (ACAD2015)

 

 

Did you place the field in an attribute definition (ATTDEF) on in MTEXT??

 

 

What's your FIELDEVAL setting??  Mine's 31

0 Likes
Message 27 of 35

wtriplett
Contributor
Contributor

I have a file that contains multiple blocks.  I use the design center to drag and drop the blocks from this file into a drawing.

I have used the technique below to modify and existing block to create an attribute that is a combination of custom sheet fields and the block object attribute.

 

I get an ####### in the attribute field when i drag the block into the drawing.  This means that "the object referenced by the field is not a valid object"

 

I would like to be able to insert the block from the design center and update all of the same blocks without this error.  Is this possible?

 

Note: The block will work if i copy from the file containing the blocks to the drawing but only for copied blocks.  the existing blocks with the same name will not update.

 

----

 

 

Re: Attribute reference another attribute within a block (block editor) 
 
02-14-2017 11:42 AM in reply to: yan.ken

Hi @yan.ken,

 

This is a new trick for me and I think it is pretty cool. Congrats to @BeekeeCZ 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.

 
Message 28 of 35

Anonymous
Not applicable

I know this is a bit of an old thread and was hoping to evolve what I've created.

 

I've created a block that has 3 attributes which sync with a main attribute, all within the same block. Does anyone know if it's possible to hide the 3 attributes so they don't appear in either the Attributes section of Properties or within the Enhanced Attribute Editor? (On a drawing there can be between 10 and 30 of these blocks and various times the Sync'd attributes has been overridden).

 

I tried a different idea using a field within MText instead of an attribute, but I can't get this to work while the MText is within the block. An idea how to get this to work if it's possible?

 

I've attached what I've created originally.

 

Cheers

Paul

0 Likes
Message 29 of 35

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Does anyone know if it's possible to hide the 3 attributes so they

>> don't appear in either the Attributes section of Properties or within

>> the Enhanced Attribute Editor?

As long as the attribute is not constant ==> NO.

My question back would be: why using attributes when you don't want to be able edit it's values (if you don't see them you can't edit them)?

 

- alfred -

 

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 30 of 35

Anonymous
Not applicable

The Block I've created (and attached) has a Pole descriptor, and within each Pole there are 3-pole switches, each with there own descriptor.

 

The way I created the attributes was to reference the Pole letter (i.e. Pole C) within the Switch reference (i.e. Switch C1), so all the draughtsman needs to do is change the Pole letter once and the 3 switch references update automatically (which i learned via this and another forum post).

 

I want the Switch references to be visible, but not editable. As drawings can contain over 10 to 20 of these blocks, all individually labelled. And in the past due to rushing, various drawings have gone out were the draughtsman has double clicked the block and (for example) have replaced Switch C1 with just D instead of changing the Pole reference.

 

Ideally I'd replace the 3 switch references with MText, but I couldn't get the fields to update outside the block the same way the attributes did.

0 Likes
Message 31 of 35

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

You could try:

  • create a new layer and set it to be locked
  • start block editor with that block
  • change your 3 attributes "SWITCH_1", .... to sit on that layer
  • close block editor with save
  • run command _ATTSYNC with that block

... does that help? 😉

 

- alfred -

 

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 32 of 35

Alfred.NESWADBA
Consultant
Consultant

Hi again,

 

attention: the display is updated, but e.g. looking to the property window or using DATAEXTRACTION shows incorrect values for the SWITCH...attributes.

So if it's just necessary to keep the guys away from edit them and plot the result, ok, but take care when these other attributes are used in any automatism!

 

- alfred -

PS: i tested that with AutoCAD 2019.1.2, could make differences as I would not know of any documentation which handles this situation of attributes with fields when sitting on locked layers 😉

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 33 of 35

Anonymous
Not applicable

Alfred,

 

Cheers, worked but didn't 🙂

 

It did exactly what I wanted, except double clicking the blocks doesn't open the attribute editor anymore (states it's on a locked layer, but everything except the switch tags are on unlocked layers), and after discussing with another senior member, decided this would be more confusing for others than trying to get them to "not" edit the switch details.

 

This is on AutoCAD 2018 at the minute, when I get around to download and install 2019 will have another look.

 

Cheers

Message 34 of 35

DavidRRUMCC
Participant
Participant

@Anonymous 

 

You might have already figured this out, since your latest post was about a year and half ago, but I was having this issue, so it may help someone else (Autocad 2021 here, but I am pretty sure this applies to a lot of previous versions):

 

Here is how I make a invisible attribute to feed into another note:

DavidRRUMCC_0-1603465486061.png

 

This was important because I was originally simply using a single multiline attribute before, which you can't edit quickly and do multiple at once, which makes adding counts for rebar cumbersome. Doing this and putting a field inside "NOTE" linking to "COUNT" after inserting the block into the drawing and then copy and pasting that block works... IF  you make sure to UPDATEFIELD > ALL every time you want the blocks to update. Just be careful not to change the "NOTE" value after getting what you want in there.

 

As to why I needed multiline attributes: single line attributes do not play well with the MIRROR command (MIRRTEXT system variable set to 0), as any change to the text of a single line attribute will result in the text moving away from the point you want the text to remain at with its mirrored justification. Multiline attributes work like you would expect. I didn't even want the FLIP action (dynamic block function), as that is another grip to contend with and I like my blocks as simple as possible.

 

Doing this, I can select multiple blocks and change the qty in the properties without going through several clicks for each quantity I want to input.

 

I just tested this: I made the same block described above, then nested that block into another "safety block" with the fields that I wanted into my blocks.dwg. And used the INSERT command to insert the safety block into another drawing, exploded that block, and the original block then works like intended... which means I don't have to go into the FIELD dialog boxes every time I want to use the block anymore.

 

For the sake of understanding the procedure set up, let's call the used block, block "A", and the block being nested into, block "B"

As a result all I have to do to is insert block B into the target drawing, then explode that block and then copy block A to all the places I need, then use properties to change that block... multiple of them at once if desired.

 

I just saved at least 30 minutes per drawing using this approach. Granted, I could import quantities by extracting information from blocks, but there are a lot of times where I prefer being able to use standard autocad commands (polyline mostly) for certain rebar, and sometimes there will be overlaid items accidently, so extraction would be dangerous for me anyways.

 

Oh and ATTMODE controls how attribute visibility works, and should be set to "1". It is drawing controlled, so make sure your template is set right for that.

 

Cheers! Good luck!

 

BTW, work is starting, so I have to get to it, but let me know if you want a video of a step and I will get to it eventually.

0 Likes
Message 35 of 35

OliverE
Advocate
Advocate

Can anyone provide a solution to a similar problem I'm having using Callout and Label Blocks with the Sheet Set Manager? I've created the blocks in the attached dwg for use with SSM. I'd like the Label Block to display the Sheet Title of where the Callout Block is inserted. I have not been able to find anything that suggests there is a simple solution to this issue using the built in SSM functionality, presumably because you can insert multiple instances of the Callout Block on different Layouts so the Label Block would not know which location to reference. 

 

However, I figured there might be a way to achieve what I want with a little manual adjustments made after an instance of each block has been created within the drawing. Therefore, I have tried inserting both blocks into a sheet that is part of the associated Sheet Set so that instances of both exist within the drawing. Then selecting the attribute I'd like to change on the Label Block and right-clicking in its value entry box -> Insert Field -> Object -> Select Object. However, I cannot select the Callout Block if it is on a different Layout or location to the Label Block.

 

It would be great if there were a solution that didn't require the additional steps after inserting each block and was hoping this was maybe achieved by adding a dynamic feature such as a Visibility State in the block's definition within the Callout/Label block dwg that gets added to the Sheet Set as a property.

 

Any help would be greatly appreciated.

 

Thanks,

 

C3D2021, Windows 10

0 Likes