You can use fields (AutoCAD 2005 and later) to create automatic labels that provide information about objects.
I’ve covered aspects of this topic before. In “Tutorial: Display the area of an enclosed figure,” I show how to use fields to create a label that displays an area.
In “Tutorial: Create attributes,” I mention that you can use fields in attributes.
In this tutorial, I’ll expand on the idea of using fields in attributes, which are labels attached to blocks. This example shows the use of fields that label geometric parameters of dynamic blocks.
- Open the Block Editor. (Tools> Block Editor or Blocks & References tab> Block panel> Block Editor.
- Create the objects for the block.
- Create the parameter and action you want to label. For example, for a desk, I created a Linear Parameter and a Stretch Action. I renamed the Linear parameter’s label to Length in the Properties palette. If you need further instructions, you can download my complete dynamic blocks tutorial from my “Dynamic blocks tutorial” page.
Did you find this tip helpful?
Don't miss new tips!
Plus get a free Dynamic Blocks tutorial
Enter your name and email below
- Start the ATTDEF command (Draw> Block> Define Attributes or Blocks & Reference tab> Atrtributes panel> Define Attributes).
- In the Attribute Definition dialog box, type in a tag name, such as Length. For the Deafult entry, type the text that you want to appear before the value, such as Length: . (Add a space after the colon.) Check the Constant check box so that you won’t get a prompt. The whole point is to make the label automatic. Set the Text Settings section as desired.
- Then right-click in the Default text box or click the Insert Field button at the right to open the Field dialog box. From the Field Category drop-down list, choose Objects. Then choose BlockPlaceholder as the field name. The Block reference property should be the name of the parameter you used. This is Length in our example. Set the format as desired, and click OK.
Note: The Length property is on the list only because I created a parameter named Length. The other properties are available for all blocks.
- You’re now back in the Attribute Definition dialog box, which should look like the figure below. Click OK. Place the label where you want it.
- Save the dynamic block by clicking the Save button in the Block Editor. Close the Block Editor.
- Back in your drawing, insert the block (Insert> Block or Blocks & References tab> Block panel> Insert). Before you specify the insertion point, you’ll see the following for the label.
After you insert the block, you’ll see the value of the field.
- After you modify the dynamic block, you’ll need to update the field. In this example, changing the length makes the desk longer. Enter updatefield on the command line to update the field.
Tested in AutoCAD 2009.