Fields Referencing Same Block

Fields Referencing Same Block

Michael.BrubakerR9GDT
Participant Participant
4,384 Views
22 Replies
Message 1 of 23

Fields Referencing Same Block

Michael.BrubakerR9GDT
Participant
Participant

Hello all, I am relatively new to AutoCAD. I'm sure this has been asked in numerous different ways but I can't seem to find the answer I am looking for. I might not be wording what I'm looking for clearly in my searches. 

 

Attached is a sample block that when inserted ask the user for specific information. I want the fields inside the block to update accordingly.

0s there a way to do this that isn't convoluted or has my users exploding the block? I will be doing this for numerous blocks to make editing these types of drawing super simple for my users.

 

Any help would be greatly appreciated.

 

EDIT: These blocks will be reused multiple times with different values in the same drawing so I cannot have a nested block with the outermost being the fields updated on the innermost block.

 

 

0 Likes
Accepted solutions (1)
4,385 Views
22 Replies
Replies (22)
Message 2 of 23

ChicagoLooper
Mentor
Mentor

Your attributes for your block named 'Reg' are invisible. Enter the command BATTMAN on command line, then do this for all 3 tags: CKT, REGA, and REGVA.

 

BATTMAN.png

 

 

 

Chicagolooper

EESignature

0 Likes
Message 3 of 23

Michael.BrubakerR9GDT
Participant
Participant

I want these to be invisible so the user does not see them. The '----' are fields that should update accordingly to the invisible attribute definitions.

0 Likes
Message 4 of 23

Libbya
Mentor
Mentor

If you make the mtext that contains the fields into attribute values (multiline in this case) then it should all work the way you propose.  The user would need to avoid editing the values that contain the fields, though. 

0 Likes
Message 5 of 23

Michael.BrubakerR9GDT
Participant
Participant

That is what I thought of doing, attributes with fields based off the defined attributes. Is there no way to do embedded fields in MTEXT instead? Or is there a way to hide certain attributes so the user cannot see or edit them? 

 

A lot of these fields will be duplicates, for instance Circuit Number would be a field for a name but also a prefix for the three switches. having this as 4 attributes when I only need the one is cumbersome. 

0 Likes
Message 6 of 23

Michael.BrubakerR9GDT
Participant
Participant

I just tried changing it from Fields to Attribute definitions and that does not work either. I added dynamic parameters to rotate the block and text how I want. 

 

Anyone have any ideas?

0 Likes
Message 7 of 23

Libbya
Mentor
Mentor

Check this box:

 

field.jpg

0 Likes
Message 8 of 23

Libbya
Mentor
Mentor

I would also mention that you must perform a single dynamic action in order to 'jump start' the fields.  They will not update until a single dynamic action is performed on the block.  If you are using tool palettes for block insertion, then the action can be performed prior to the tool being made in order for the fields to function immediately upon insertion.

0 Likes
Message 9 of 23

Libbya
Mentor
Mentor

You can experiment with placing the attributes you do not want edited on a locked layer.  In this case it would probably work to prevent users from editing the attributes with fields.  You could also use user parameters for housing the values (and blockplaceholder fields) and in that case, the user would edit the values at the properties palette rather than in the edit attributes dialog.  

0 Likes
Message 10 of 23

Michael.BrubakerR9GDT
Participant
Participant

@Libbya I checked those fields and reinserted the block. I am not sure what you mean by tool insertion so it works immediate. I do have a rotate and point move commands in the block and even after using them they do not update. the only way I've got it update so far was after block insertion I edited the fields for the "DO NOT CHANGE" attributes. and now they are set to a block reference instead of attribute definition.

 

I can now copy and place this new edited block and it works as intended for updating the fields at least. This defeats the purpose a little as I would have to copy the new instance of this block to wherever I need it instead of having it in a library that I can insert into multiple drawings. 

 

see test2 versus test3, check edit fields under block attribute definition.

0 Likes
Message 11 of 23

Libbya
Mentor
Mentor

You can create block insertion tools on your tool palettes (if you use the tool palettes) and if you do the dynamic action prior to creating the tool on the tool palette, then the block will already have that dynamic action performed when the block is inserted using the tool palette.  If you do not use tool palettes, then you might consider doing so as they make easy work of insertion of blocks or other items from one drawing to the next.  

0 Likes
Message 12 of 23

Libbya
Mentor
Mentor
Accepted solution

Hopefully the following screencast helps.  Things to keep in mind...  Fields within mtext that are referencing attribute values will show only their default value and will never update with changes to the attribute value.  Fields within attributes that reference another attribute value *will* update with changes to the referenced value, provided the 'display value for block reference' check box is checked AND a dynamic action is performed at some point in the life of the block.  Attributes that you do not want edited can be placed on a locked layer.  The values that you DO want edited would then be edited by selecting the block and editing those values in properties.  See screencast:

 

 

0 Likes
Message 13 of 23

Michael.BrubakerR9GDT
Participant
Participant

@Libbya  I enabled the tool palette and added the block to that. I enabled the check box to use the block reference. I can change the attributes and do a regen and it will update accordingly. It still doesn't update when I place it from the tool palette. I assume I need to add another dynamic property on insertion but I am a little loss as to how to accomplish that. 

 

For now if the user sees the field I'm not too worried but eventually I would like to go through the process to hide the fields I don't want them editing. I think for now I will put them on an un-editable layer. 

0 Likes
Message 14 of 23

Michael.BrubakerR9GDT
Participant
Participant

@Libbya That screencast definitely did help. In essence that was the same process I followed. The only difference is mine still doesn't update on insertion, only when I call a regen.

0 Likes
Message 15 of 23

Libbya
Mentor
Mentor

Did you create your tool palette tool by dragging a block onto the tool palette?  Was a dynamic action (rotate) performed on the block prior to dragging it onto the tool palette?  Did you save the host file immediately prior to creating the tool?

0 Likes
Message 16 of 23

Michael.BrubakerR9GDT
Participant
Participant

Yes, I have the block creating. did a rotate with the dynamic command. saved. dragged block to palette. tried using palette to create new block instance and entered the parameters. hit OK, block did not update.  But if regen is all I have to do then that's not an issue.

0 Likes
Message 17 of 23

Libbya
Mentor
Mentor

You always need to regen to immediately show an updated field value.  The field will update automatically on save, close, plot, etransmit, but to see the change immediately you need to regen.

0 Likes
Message 18 of 23

Michael.BrubakerR9GDT
Participant
Participant

@Libbya That works for me. Thanks for all the help. 

0 Likes
Message 19 of 23

JLJZPWBF
Enthusiast
Enthusiast

@Libbya - Can anyone shed some light as to why I don't get the "Display value for block reference" check box?

Also, do you have sound with your screencast?

 

0 Likes
Message 20 of 23

Libbya
Mentor
Mentor

No sound in any of my screencasts.

 

If you attached your block instead of images, I could tell you, but I don't really find it fun to guess.

0 Likes