Have You Tried: Work with Attributes in Blocks

Note: Steps, images, and videos may differ slightly from your version of the product.

Attributes, like geometry, can be added to a block when it is initially created with the BLOCK command or later when being edited in the Block Editor (BEDIT command).

  1. Open a new drawing, draw a rectangular object that is 30”x72” to represent a conference table. Not all conference tables are rectangular, so feel free to add some curved edges.

  2. Enter ATTDEF at the command prompt.
  3. In the Attribute Definition dialog box, specify the values shown in the following image:

    The properties in the Attribute section are used to control the text that is displayed in a drawing and the value assigned to the attribute.

    • Tag - Visible placeholder text that is displayed in the drawing window prior to the attribute being added to a block; value provided is used to identify the attribute when extracting values from a block.
    • Default - Replaces the Tag and is the value assigned to the attribute upon the insertion of a block.
    • Prompt - Message string displayed in the Edit Attributes dialog box or at the Command prompt during the insertion of a block to let you know the type of information an attribute expects.
  4. Accept the values provided and specify the insertion point for the attribute, the best place is inside of the geometry that defines the conference table.
  5. Start the ATTDEF command again to create a second attribute definition, and specify the values shown in the following image:

    Note: The Invisible mode suppresses the visibility of the attribute on-screen and keeps the drawing from looking too crowded, while still providing the benefits of being able to add information to a block. The visibility of hidden attributes can be toggled with the ATTDISP command.


  6. Enter BLOCK at the command prompt.
  7. In the Block Definition dialog box, specify the values shown in the following image:

  8. Accept the values provided and specify the center of the table as the base point for the block.
    Tip: The Mid Between 2 Points object snap is an efficient way to find the center point of the table. When prompted to specify the base point, hold SHIFT and right-click to choose the Mid Between 2 Points option.
  9. Select the geometry of the table, and then select the FURN_LBL attribute followed by the FURN_DESC attribute.
    Note: The prompt order for attribute values is determined by the order in which attributes were selected while defining a block; this order can be important when creating scripts or AutoLISP programs. The BATTMAN command can be used to change the prompt order of attributes in a block.
  10. In the Edit Attributes dialog box, accept the default values.

  11. Chairs are commonly found in a conference room, so create a block named CH1 that represents a chair and add the same two attributes that you defined for the conference table in the steps 5-7. Assign the Default values of CH1 and CONFERENCE CHAIR W/O ARMS for the FURN_LBL and FURN_DESC attributes in the chair block, respectively.

Insert a Block with an Attribute

While inserting a block with attributes, you can accept the default value or provide a new value for each attribute in the block.

  1. Start the INSERT command.
  2. In the Insert dialog box, choose the block that represents the conference table that you previously created.
  3. Accept the values provided and specify any expected values to insert the block.
  4. In the Edit Attributes dialog box, edit the default value for each attribute as needed.

  5. Insert several of the conference chair blocks along the two longer sides of the conference table.

  6. Save the changes to the drawing.
Note: If the Edit Attributes dialog box isn’t displayed when inserting a block, set both of the ATTREQ and ATTDIA system variables to a value of 1.

After inserting a block with attributes, you can double-click the block to edit the current value of each attribute in the block.

Now that you have a basic understanding of defining and inserting blocks with attributes, you can extract the values of the block attributes into a table by continuing onto the Have You Tried: Extract Attribute Values from Blocks topic.