Before you can extract attribute data, you need to have attributes. Attributes are labels attached to blocks to convey information that can’t be shown visually in a drawing—for example, cost, manufacturer, part number, etc. Attributes can also be used to present text in a block. The most common instance of this use is the title block, in which attributes are used to display title block information such as drawing name, revision number, date, scale, and so on. Using attributes to show this information makes it easier to update title blocks when information changes.
The first step is to draw the objects that will make up your block. If the block already exists, you’ll need to explode it before you can add your attributes. Once you’ve created your block geometry, start the Attdef command by typing Attdef at the command line or select it from the Draw / Block / Define Attributes menu.
The Attribute Definition dialog box will display.
Caption: Attribute Definition dialog box.
In Attribute section you enter the Tag, which is the attribute name. You will use tags when you extract attribute data. Think of them as the column headers in your data table. Note that the Tag cannot include spaces or exclamation points, and it will end up all uppercase.
Prompt is the text that will prompt you to enter a value for the attribute when you insert the block.
The Default window lets you enter a default value, handy if the attribute value is often the same. Your selections in the Mode area, discussed next, will affect how the default value is applied when you insert the block. You can specify a field as the default value by selecting the Field button at the right.
Caption: You can set a field to be the default attribute value.
The Mode options in the Attribute Definition dialog box affect the behavior of the attribute. You can select more than one mode unless they are mutually exclusive.
Invisible means that attribute values will not display in the drawing. Select for data you want to extract to a table or database, but not for text you want to display.
Constant sets a constant value for the attribute—the value you enter in the Default box in the Attribute section. The attribute will automatically assume this value, and you will not be prompted to enter a value.
Verify, when checked, will prompt you to confirm the preset default value when the block is inserted.
Preset automatically inserts the default value. If you want a different value, you can type it in. Note that ATTDIA system variable must be set to 1 for AutoCAD to display a prompt that lets you change the value.
Multiple Lines simply lets you attribute have more than one line of text. Click on the ellipsis to open a simplified mxtext editor in which you can format your attribute.
Note: When Multiple lines is checked, you can’t access the Default window. Instead, enter your default value by clicking the ellipsis button that appears.
The Text Settings section is where you format the attribute text. You don’t need to bother with this if your attributes are for extraction. If you are setting up a title block, however, you’ll want to assign a text style and justification. If you make the attribute annotative, it will automatically scale to match the viewport scale. Otherwise, set a height that takes the scale factor into account.
Under Insertion Point, check Specify On-screen if you want to pick the insertion point when you insert the block. Uncheck it if you want to specify particular coordinates.
Once you define one attribute, the Align below Previous Attribution Definition check box becomes active. Check this if you want subsequent attributes to line up under the first one.
Lock Position locks the position of the attribute in relation to the block. When an attribute is not locked, it has a grip that allows you to move it independently. A locked attribute has no grip and moves when the block itself moves. Note: You must lock any attribute you want to include in the selection set of an action in a dynamic block.
Caption: Attribute creation results. The three at right are aligned.
Once your geometry and attribute definitions have been created, it’s time to create a block. We’ll discuss that process next time.