Attributes are tags, or labels, for blocks. You can use attributes to add any text to a block. For example, attributes are often used to fill in the text in a title block.
By placing the attributes where you want them in the title block, you can facilitate the entering of the text. You can also use fields in attributes, to automate some of the text entry.
You can extract the attributes in a drawing to a table or external file. When you do this, you can use the attributes to create a simple database. You could import it into Excel and manipulate it there.
If you’re using attributes to create title block text, you’ll be working in paper space on a layout. If you’re using them to create labels in the rest of your drawing, you’ll be working in model space.
Start the ATTDEF command
Draw the objects that will make up the block. (If you already have a block and want to add attributes to it, you can explode the block, add the attributes, and recreate the block. You can also open the block in the Block Editor, add the attributes there, and save the changes.)
Choose Home tab>Block panel (expanded)>Define Attributes (ATTDEF command) to open the Attribute Definition dialog box.
Configure the Mode section
In the Mode section, check one or more of the following:
- Invisible: Creates invisible attributes that you can extract, but don’t want to display in the drawing.
- Constant: Sets a constant value so that you don’t need to fill it in each time. You cannot edit this value.
- Verify: Prompts you to verify the value, useful when you have a preset.
- Preset: Inserts a default value, but you can edit it if you set the ATTDIA system variable to 1.
- Multiple Lines: Allows an attribute to contain multiple lines of text. You can also format attributes in a simplified text editor.
Check the Lock Position check box to lock the position of the attribute relative to the block, so that you can’t grip edit it and move it.
Configure the Attribute section
In the Attribute section, specify the Tag, which is like a field/column name for the attribute. For example, enter Cost if the attribute will contain cost information. The tag is converted to uppercase and cannot contain spaces or exclamation points.
Enter a prompt, which is similar to the tag, but can contain spaces.
Enter a value to set a default value. In AutoCAD 2008, this is called the Default. To insert a field, click the Insert Field button.
In the Text Options/Settings section, choose a justification, text style, height, and rotation.
In the Insertion Point section, check the Specify On-Screen check box to specify the location of the attribute. Otherwise, enter the desired coordinates.
Click OK. At the prompt, specify the location if prompted.
Check out this free dynamic block tutorial
Plus get free tips in our AutoCAD Tips Newsletter!
Get a free tutorial on creating a complete dynamic block, including a drawing to practice on. You'll make a movable chair, resizable desk, and more. PLUS, the highly-acclaimed AutoCAD Tips Newsletter will keep your skills up to date!
Make the block
Choose Make Block on the Draw toolbar (BLOCK command) and use the Block Definition dialog box to create the block. When you select the attributes, separately pick them in the order you want them to appear to prompt you for values. You can choose the Delete option to delete the block and attribute items, because you’ll insert the block later, with its attributes. For instructions on making a block, see “Making a block in AutoCAD.”
When you’re ready to insert the block, you can specify attribute values on the command line or in a dialog box. The default depends on which AutoCAD release you’re using. To use a dialog box, change the value of the ATTDIA system variable to 1.
Insert the block
Use the INSERT command to insert the block. For instructions, see “Insert a block in AutoCAD.” If you set ATTDIA to 1, you then see the Edit Attributes dialog box, where you specify values. Otherwise, you see a prompt on the command line. Any default values that you entered are shown in the text boxes.
Enter the desired values and click OK. The block now shows the attributes (unless you set them to invisible).