Reference
ATTDEF in AutoCAD
How AutoCAD's ATTDEF (ATT) defines a block attribute: its modes, tag, prompt and default value, then where its text goes. Try it free in your browser.
ATTDEF defines an attribute: a tag, a prompt and a default value, placed in the drawing as a line of text. Select it with the other objects when you make a block with BLOCK, and each reference to that block holds a value of its own for it: a door's number, a part's code, a room's name. Until then the definition shows its tag.
AutoCAD's ATTDEF opens the Attribute Definition dialog, which MellowCAD does not have: here ATTDEF asks at the command line what -ATTDEF asks, as AutoCAD's console does. It says the current modes and asks for one to change, until Enter goes on. Then the tag: no spaces, as a space ends it, and lower case is made upper case; Enter alone says Tag cannot be null. Then the prompt that INSERT will ask the value by, Enter taking the tag, and the default value. Last, where the text goes, with TEXT's questions: a start point, the height and the rotation. The height and the justification are TEXT's, shared both ways. Enter at the start point puts the definition one line below the last one defined, with its height, rotation, style and justification, so a block's attributes stack one under another.
- Command:
ATTDEF - Aliases:
ATT,DDATTDEF - Panel: Organize
- Try it: Open the editor, type
ATTand press Enter.
At the command line
The engine draws it and writes its history as you would type it: the prompts in AutoCAD 2027's order, with the same option letters.
- Command: ATTDEF
- Current attribute modes: Invisible=N Constant=N Verify=N Preset=N Lock position=Y Annotative=N Multiple line=N
- Enter an option to change [Invisible/Constant/Verify/Preset/Lock position] <done>:
- Enter attribute tag name: NUM
- Enter attribute prompt:
- Enter default attribute value: 1
- Current text style: "Standard" Text height: 2.50 Justify: Left
- Specify start point of text or [Justify/Style]: J
- Enter an option [Left/Center/Right/Middle/TL/TC/TR/ML/MC/MR/BL/BC/BR]: MC
- Specify middle point of text: 0,0
- Specify height <2.50>: 5
- Specify rotation angle of text <0>: 0
Options
Invisible (I)
The value does not show on the references, until ATTDISP turns it on. Each mode is a switch: choosing it flips it between Y and N, writes the modes again and asks once more. The modes stay set for the next ATTDEF.
Constant (C)
Every reference holds the same value, which ATTDEF asks for instead of a prompt and a default; INSERT never asks it.
Verify (V)
INSERT asks the value a second time, to check it, after asking every value once.
Preset (P)
INSERT does not ask the value: each reference takes the default.
Lock position (L)
On at first: the attribute stays where the block puts it.
Justify (J)
Asks where the text hangs from its point, as TEXT does: Left, Center, Right, Middle, or one of the nine points by top, middle and bottom, left, centre and right. The start point prompt then asks for the point it names: middle centre centres the value in a tag.
Style (S)
Asks for the text style to use, which becomes the current one; ? lists the drawing's styles.
What it does not do yet
The Attribute Definition dialog: ATTDEF asks at the command line. The Annotative and Multiple lines modes, which AutoCAD 2027 lists after Lock position, and a multiline attribute's lines. Fields, the Align and Fit justifications, and Style's ? asking which styles to list.
What it does and still lacks, in detail (in English)
Questions
What is the shortcut for ATTDEF in AutoCAD?
ATT, then Enter or Space; DDATTDEF too. -ATT is -ATTDEF, the command-line form, which ATTDEF runs here too. _ATTDEF works in any language of AutoCAD.
How do I create a block with attributes in AutoCAD?
Draw the symbol, then run ATTDEF for each attribute and place its text where the value should show. Run BLOCK, pick a base point and select the symbol and the attributes, in the order INSERT should ask them. Each INSERT of the block then asks a value for each attribute, offering its default.
What is the difference between the tag, the prompt and the default value?
The tag names the attribute, as an identifier: it is what the definition shows, and the field EATTEDIT labels. The prompt is the question INSERT asks for its value. The default is the value offered, which Enter accepts.
How do I edit an attribute definition?
Double-click it before it joins a block: TEXTEDIT opens its tag, prompt and default value. Once in a block, the values of each reference are edited with ATTEDIT or EATTEDIT.