Videos

Adding an Attribute to a Block

Adding an Attribute to a Block
Learn how to add an attribute to a block in AutoCAD 2018. Get quick and easy video tutorials on blocks and attributes by AutoCAD experts.

Adding an Attribute to a Block

An attribute is a label or tag that attaches data to a block. Since attributes are part of a block definition, they must be saved as part of the block. When you first create the block, you can create each attribute as an object and then save those attributes along with the other objects that make up the block. Or, you can add attributes to an existing block by opening the existing block in the Block Editor and then add attributes to the existing block definition.

In this drawing, lines and arcs have already been used to draw a telephone. Before you turn it into a block, however, you will add some attribute definitions so that you can store data such as the telephone number assigned to the phone and the name of the person who uses the phone. After you add those attributes and save the block, when you insert instances of the telephone block into the drawing, you will be able to specify the telephone number and username to each instance of the block. Then, at a later time, you can extract that data to create a parts list, or perhaps a telephone directory.

Before you create the block, you must create a new layer on which to create the attributes. Expand the Layer Property Manager palette and create a new layer named “ATTRIBUTE-TEXT” and make it the current layer. Click its color button to open the Select Color dialog, select Red, and click OK.

INTERESTING:   Plant 3D with the Experts (video blog series): Where to get help | AutoCAD

Now you are ready to define your first attribute. On the Insert ribbon, in the Block Definition panel, click the Define Attributes button. The program displays the Attribute Definition dialog.

There are several pieces of information that you must provide, and several options that you can choose. In the Attribute group box, each attribute must have a unique tag, which is essentially the name of the attribute. You can also enter a prompt that will appear when you insert the block so that you know the purpose of the attribute. And, you can specify a default value for the attribute.

In the Mode group box, you can select any of the checkboxes to control whether the attribute will be invisible or visible, whether it has a constant or variable value, whether the program will prompt you to verify the attribute value, and so on.

In the Text Settings group box, you can specify the appearance of the attribute text, controlling settings such as the justification, text style, text height, and so on.

The first attribute will be for the phone number. In the Attribute group box, click in the Tag field and type “PHONE” and then press the TAB key. In the Prompt field, type “WHAT IS THE PHONE NUMBER?” and press the TAB key. In the Default field, type “0 “.

In the Text Settings group box, expand the Justification drop-down and choose Middle. You can leave the Text style set to chisel and the Text height set to 0.5 units or 1/2″.

INTERESTING:   Programmatically Set the Select File Saved Places Locations

In the Mode group box, leave the Invisible checkbox cleared so that this will be a visible attribute. You can leave the other settings as you see them. Click OK to close the dialog.

The program prompts you to specify the start point. Use object snap tracking to locate the center of the upper rectangle and then click to position the text. The attribute tag is immediately added to the drawing.

Now that you have defined an attribute, you are ready to convert these objects into a block. On the Insert ribbon, in the Block Definition panel, click the Create Block tool. The program displays the Block Definition dialog. In the Name field, type the name you wish to assign to the block, in this case “PHONE “. Then, click the Pick Point button. The program prompts you to specify the insert base point. Use object snap to select the lower-right corner of the telephone. Then, back in the Block Definition dialog, click the Select objects button and then use a window to select all of the objects that will comprise the new block, including the attribute that you just defined. Then, right-click to complete the object selection. Back in the Block Definition dialog, note that you are about to delete the objects that you just included in the block definition. Click OK.

Now you are ready to insert an instance of the telephone. On the Insert ribbon, in the Block panel, expand the Insert split button, locate the new PHONE block in the block gallery, and click to select it.

INTERESTING:   AutoCAD 2011 Parametric Constraints

The program prompts you to specify the insertion point and you can see a preview image of the telephone. Click to place the block. As soon as you do, the program displays an Edit Attributes dialog and you can see the prompt that you defined: WHAT IS THE PHONE NUMBER? Type the phone number-” 867-5309 “-and then click OK.

As soon as you do that, the block is added to the drawing. You can see that the block includes the attribute data that you entered. You can see that data because you defined the attribute as a visible attribute.

Source: Autodesk

Back to top button

Adblock Detected

Please disable your ad blocker to be able to view the page content. For an independent site with free content, it's literally a matter of life and death to have ads. Thank you for your understanding! Thanks