Вы находитесь на странице: 1из 8

WORKING WITH

ATTRIBUTED BLOCKS
Definition
An attribute is a text item that is attached to a block definition. Attributes expand the
definition of a block to include text information that you provide.
Concepts
When you define an attribute, you specify its features, such as an identifier, an initial
value, its appearance, its location relative to the associated block, and other
properties.
An attribute becomes part of a block definition.
When you insert an attributed block into a drawing, the attributes are also inserted.
An attributes value can be the same or different for each insertion of the block,
depending on how you have defined the attribute.
A block can have multiple attributes.
AutoCAD provides a set of commands for working with attributes.
CREATING AN ATTRIBUTED BLOCK
1. Draw the geometry (if any) that comprises the block.
2. Invoke the ATTDEF command to create and place an attribute (see below). Repeat
this step once for each attribute you wish to associate with the block.
3. Invoke the BLOCK command to convert the geometry and attributes to a named
block. When prompted, select the geometry, then the attributes in the order you want
their prompts to appear when you insert the block.
ATTDEF
You invoke the ATTDEF command to define an attribute. This command lets you specify
not only the attribute text, but also numerous related features: its position relative to the
block geometry, the text style, justification, height, rotation, an initial value, and so on.
ATTDEF prompts you for information via a dialog (see Figure 1); invoke the -ATTDEF
command to be prompted on the Command line for the same information.
Command line:
Pulldown:
Toolbar:

ATTDEF (or ATT)


Draw Block Define Attributes
none

Insert field
button

Figure 1. Attribute Definition dialog

An identifier for the attribute. The tag cannot contain spaces. You can
enter the tag in lowercase, but AutoCAD converts it to uppercase. The
tag appears in your drawing until you make the block. When you insert
an attributed block, the tags are replaced by the values you supply.
Prompt
The text that appears during block insertion that asks you to enter the
value for the attribute.
Value
An initial value for the attribute. Depending on other attribute settings,
you may be able to change the value when you insert the block.
Insert field
This button (see Figure 1) displays the Field dialog box. You can insert a
field as all or part of the value for an attribute. See Defining Fields as
Attributes in the next section.
Insertion Point The location of the attribute. In the ATTDEF dialog, you can specify an
insertion point for the attribute by entering coordinates in the X, Y, and
Z boxes, or you can check the Specify On-screen button to select an
insertion point on the screen after you close the dialog box.
Justification
Any of the typical text justification methods. Refer to the AutoCAD
online help for more information about choices for text justification.
Text Style
A text style for the attribute. The style must already be defined in the
drawing.
Height
The size of the attribute text. You can enter the text height in the box, or
you can pick on the Height < button and specify the height by picking
two points on the screen. AutoCAD calculates the distance between the
two points you pick and supplies that value for the text height.
Rotation
The rotation angle of the attribute text. You can enter the rotation angle
in the box, or you can pick on the Rotation < button and specify the
rotation angle by picking two points on the screen. AutoCAD calculates
the rotation angle of an imaginary line between the two points you pick.
Tag

Mode
Invisible

Constant

Verify

Preset

Align below

Lock position

The Mode specifies additional attribute features.


An invisible attribute is not displayed in the drawing, even though you
can assign a value to it when you insert the block. Make an attribute
invisible to reduce clutter on your drawing or to protect sensitive
information from view. You can force invisible attributes to appear by
invoking the ATTDISP command (see below). An invisible attribute has
no grip and requires special handling to be re-positioned (see ATTEDIT
below).
A constant attribute has a fixed value that cannot be changed after it has
been defined. You are not prompted for a value when you insert the
block, nor can you edit the value after block insertion. You do not need
to enter a prompt for a constant attribute, but be sure you supply an
initial value.
In command line mode (i.e., ATTDIA is 0), you are prompted a second
time for all attribute values for which you select the verify option. This
option has no effect if you enter attribute values in a dialog box.
The preset option automatically supplies the initial value for an attribute.
Be sure you supply an initial value for a preset attribute. Unlike a
constant attribute, you can change the value of a preset attribute after
you insert the block.
This option becomes accessible after you have defined the first attribute
for a block. If checked, subsequent attributes are automatically
positioned below the first one you define and are assigned the same text
style, justification, height, and rotation angle.
If checked, the attribute is locked into position and cannot be moved
separately from the rest of the block. A locked attribute has no grip.
Lock Position is checked by default. If you make a block with locked
attributes and wish to unlock them, you can change this setting in the
Dynamic Block Editor (see Introduction to Dynamic Blocks in Unit 6).

If you want to change any property of an attribute, it is easy to do so before you define
the block. Simply select the attribute and make the modification in the Properties
window. After the attribute has been turned into a block, you must invoke a block editing
command (see below) to modify attribute properties.
After you have defined all the attributes for a block, invoke the BLOCK command, select
all block geometry and attributes, and proceed as you normally would to define a block.
INSERTING ATTRIBUTED BLOCKS
You invoke the INSERT command to insert an attributed block. The Insert dialog box
appears (see Figure 2).
Command line:
Pulldown:
Toolbar:

INSERT (or I)
Insert Block
Draw

Figure 2. Inserting an attributed block

In addition to providing an insertion point, scale factors, and rotation angle, you are also
prompted to supply values for all the blocks attributes that are not constant or preset.
Several system variables and command settings affect the prompting and visibility. To set a
system variable, enter its name at the Command prompt and then enter the desired value.
ATTDIA is
0

a system variable that controls how you are prompted for attribute values.
(default) You are prompted
for attribute values on the
command line (see Figure 3).

Figure 3. Supplying attribute values at the Command prompt

You are prompted for


attribute values in the Enter
Attributes dialog box (see
Figure 4). The dialog appears
after you select the insertion
point, scale factors, and
rotation angle for the block.

Figure 4. Supplying attribute values in the dialog box interface

is a system variable that controls whether you are prompted for attribute values
while you are inserting a block.
0
You are not prompted for attribute values. If you supplied an initial value when you
defined the attribute, that value is supplied automatically.
1
(default) You are prompted for attribute values, either on the command line or in
the Enter Attributes dialog, as specified by ATTDIA.
ATTREQ

MIRRTEXT is

a system variable that determines how text is handled in a block that is


mirrored. The value assigned to MIRRTEXT is saved in every drawing.
0
Prevents mirrored text from appearing backwards or upside-down. The text has
the same alignment and justification as before the mirroring.
1
(default) Text is mirrored by the MIRROR command, which may result in an
undesired text orientation.
ATTDISP is

a command that controls the display of attributes. You can also invoke this
command by selecting View Display Attribute Display from the pulldown menu. This
setting affects plotted drawings.
Normal (default) Turns off invisible attributes, and leaves all others on.
Off
Turns all attributes off, no matter how they were defined.
On
Turns all attributes on, no matter how they were defined.
When you insert an attributed block, the tags are replaced by the values you supply.
Figure 5 shows a sample attributed title block.

Figure 5. An inserted attributed block

EDITING ATTRIBUTE VALUES


You can modify a non-constant attribute after its block has been inserted into the
drawing. AutoCAD provides several commands for modifying attributed blocks.
The ATTEDIT (Edit Attributes) command allows you to change the attribute values
for an attributed block inserted in a drawing.
The EATTEDIT (Enhanced Attribute Editor) command lets you change attribute
values and other text options and properties for one or more attributes in a block.
The ATTEDIT command lets you change either attribute values for multiple blocks
or other attribute properties one attribute at a time.

ATTEDIT
Command line:
Pulldown:
Toolbar:

ATTEDIT
Modify Object Attribute Single
none

Figure 6. Edit Attributes dialog

The ATTEDIT command invokes the Edit Attributes dialog (see Figure 6), where you can
modify attribute values assigned to a selected block. To edit attributes for more than one
block in a drawing, first invoke the MULTIPLE command at the Command prompt and
specify the ATTEDIT command. You are prompted to select blocks for editing until you
press Esc to terminate the command.
ENHANCED ATTRIBUTE EDITOR (EATTEDIT)
AutoCAD provides a more powerful version of the ATTEDIT command that lets you
modify any attribute property for a single block at a time. Double-click on an inserted
block or invoke the EATTEDIT command and select a block to display the Enhanced
Attribute Editor dialog box.
On the Attribute tab, shown
in Figure 7a, you can select
an attribute tag and modify
the Value assigned to the
attribute.

Figure 7a. Attribute tab of the Enhanced Attribute Editor

On the Text Options tab,


shown in Figure 7b, you
can modify the Text style,
Justification, Height,
Rotation angle, Orientation,
Width factor, and
Obliquing angle for the
attribute you selected on
the Attribute tab.

Figure 7b. Text Options tab of the Enhanced Attribute Editor

On the Properties tab,


shown in Figure 7c, you
can modify the Layer,
Linetype, Color,
Lineweight, and Plot style
for the selected attribute.

Figure 7c. Properties tab of the Enhanced Attribute Editor

Click on the Select block button in the upper right corner of the dialog to select a different
block and modify its attributes without closing the dialog box.
-ATTEDIT
Command line:
Pulldown:
Toolbar:

-ATTEDIT
Modify Object Attribute Global
none

The ATTEDIT command lets you change either attribute values for multiple blocks or
other attribute properties one attribute at a time. Though somewhat difficult to use, this
command performs a function that no other attribute editing command can do as well: repositioning an invisible attribute without re-defining a block.
Depending on how you answer the first prompt, the -ATTEDIT command lets you edit
only attribute values or any attribute property. -ATTEDITs first prompt asks if you want
to edit attributes one at a time. If you respond No, you enter Global Editing mode, which
lets you edit only attribute values, either for all attributes or only those visible on the
screen. If you answer Yes, you enter Individual Editing mode, which lets you edit the
value or other attribute properties for one or more blocks.

The next series of prompts creates a selection set of attributes to be edited. You can filter
the selection set by specifying a block name, an attribute tag, and/or an attribute value.
The default value for each of these prompts is the * wildcard, which performs no
filtering. Press Enter at each of these prompts to reach a prompt where you can pick
attributes for editing.
At the Select Attributes prompt, select the attributes you wish to edit. If you select
more than one attribute, AutoCAD steps through the group one at a time, marking the
current attribute with . You can modify the Value, Position, Height, Angle, Style,
Layer, or Color of an attribute.
Choose Position to move an attribute. The attribute value is attached to the
crosshairs. Select a new position for the attribute.
You have two options for an attributes Value:
o Change lets you modify characters within a value.
o Replace lets you specify an entirely new value.
When you are finished modifying the current attribute, enter N (for Next) at the command
options list to move the to the next attribute in the selection set.
EXPLODING ATTRIBUTED BLOCKS
If you explode an attributed block, it
reverts to its pre-block appearance (see
Figure 8). The values assigned to the
attributes are replaced by the attribute
tags. The block appears as it did before
being turned into a block. You should
rarely need to explode an attributed
block.
Figure 8. An exploded attributed block

Вам также может понравиться