eplisp

AutoCAD ATTDEF Command: Creating Attributes for Blocks

Creates an attribute definition that holds a different value each time a block is inserted.

Command
ATTDEF
Aliases
ATT
English name
Attribute Definition

The AutoCAD ATTDEF command creates an attribute definition for use in blocks. An attribute is a text field that can hold a different value every time the block is inserted, such as the project name in a title block, a fixture code or the load on a panel circuit.

In the Attribute Definition dialog you fill in three main fields: Tag is the attribute name, Prompt is the question shown when the block is inserted, and Default is the default value. The Mode options control whether the attribute is visible, constant and how it is verified.

An attribute definition does nothing on its own. After creating it, include it in a block with BLOCK along with the geometry, or add it to an existing block in BEDIT.

How to use it

  1. Type ATTDEF or ATT and press Enter.
  2. Enter a Tag without spaces, a Prompt and a Default value.
  3. Check the Mode options you need and set text style, height and justification under Text Settings.
  4. Click OK and pick the location of the attribute.
  5. Include the attribute in a block together with the other objects using BLOCK.

Options

Invisible
The value is not displayed or plotted when the block is inserted; useful for storing data.
Constant
The value is fixed; you are not prompted for it and it cannot be changed.
Verify
Asks you to confirm the value when the block is inserted.
Preset
Uses the default value without prompting on insertion; the value can be edited later.
Lock position
Locks the position of the attribute within the block.
Multiple lines
Allows the attribute value to contain several lines of text.

Notes and tips

  • Tags cannot contain spaces; use underscores, for example PANEL_NAME.
  • Set ATTDIA to 1 to enter attribute values in a dialog when inserting blocks.
  • Double-click a block to edit attribute values (EATTEDIT), and use BATTMAN to manage definitions.
  • If you add attributes to an existing block, run ATTSYNC to update the blocks already in the drawing.