AutoCAD: Fields in Dynamic Blocks to Display Properties

If you need to display certain changing properties of a dynamic block you can do it using Attributes and Fields
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
Once we are in Block Editor Mode and we type ATTDEF we will get the Attribute Definition dialog Box. Here we can tag the Attribute as Width. For its default value we will ad "Width: " and after that is where we will insert the field. To insert the field we will click on the Box near the Default value Box. See the picture below.

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.

One extra step that helps in the process is to select the attribute to be constant (so we don't get a prompt asking its value).
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.kick it on CadKicks.com


6 comments:

  1. 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?

    ReplyDelete
  2. Hi xelo1,
    unfortunately, 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"

    ReplyDelete
  3. 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.

    ReplyDelete
  4. What 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.

    ReplyDelete
  5. Thanks for that tutorial Martí. Keep up the good work :)

    ReplyDelete
  6. your 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

Related Posts Plugin for WordPress, Blogger...