Català - Castellano
In a previous post, I went through the process of creating a dynamic block of an escalator with dynamic properties. The block allowed its length and width to be modified using parameters and actions. We will use that block as a reference to explain how to add a dynamic attribute.
We will attempt, as an example, to add a text that will show us the width of the steps in the escalator block. To make things simpler, you can download the block here. We will follow these steps:
- Enter the Block Editor mode (type BE)
- Define an attribute (ATTDEF)
- Insert a field on that attribute
The type of field we need to add is a "Block Place Holder". We will see all the parameters of a dynamic block listed here, plus other properties such as layer, color, etc. In this case I renamed the parameter "Distance" as "Width". So I select this one.
Update: Make sure that the attribute is NOT set to constant, otherwise it will not update when beeing modified.
Wen we finish defining the attribute we simply exit the Block editor mode and insert a new instance of the block. The new defined attribute will appear, and if we change the width of the steps (and REGEN the drawing) the field will update with the new distance.
You can download the same block with the dynamic attribute here to see it for yourself.
Tweet
I downloaded the sample of your block but the width attribute does not automatically update. It does, however update when I run the "regen" command. Thoughts?
ReplyDeleteHi xelo1,
ReplyDeleteunfortunately, fields require Regen to update as far as I know. Check the help file for the FIELDEVAL system variable, and you will see that so far there is no setting for "automatic updating"
Hi. Good job your'e doing here. Unfortunately this trick with attribute + field is not working for me. Field only is OK. I need attribute to extract dimension info from block to the table. For example, in your sample file with escalator all what can I get is "width" - a tag only and no field. I use Autocad 2010.
ReplyDeleteWhat about using attrabutes in reverse. I want to bouble click a block and change the attribute then regen and have my dynamic width change... What do you think.
ReplyDeleteThanks for that tutorial Martí. Keep up the good work :)
ReplyDeleteyour explain not enough there is same thing is missing after we close be pick on att and insert file and choose object pic on shape and choose dis
ReplyDelete