value of the field in one record
Attribute definitions

You use the Attribute Definition dialog box to create attribute definitions (clever, huh?). The procedure is similar to creating a text string, except that you must supply a little more information. Create attribute definitions with the following steps:

1. Change to the layer on which you want to create the attribute definition.

2. Choose Draw>Block>Define Attributes to run the ATTDEF command.

The Attribute Definition dialog box appears, as shown in Figure 13-4.

Figure 13-4: The Attribute Definition dialog box.

  You rarely need to use any of the Mode settings (Invisible, Constant, Verify, or Preset). Just leave them unchecked. If you’re curious about what the modes do, use the dialog box help to find out more.

3. In the Attribute area, type the Tag (database field name), Prompt (user prompt), and Value (default value).

The Tag can’t contain any spaces. The Prompt and Value fields may contain spaces.

  Attribute values can include AutoCAD 2005’s new automatically updating fields, such as date, filename, or system variable setting. Click the Insert Field button to the right of the Value text box to insert a field. See the “mText plays the field” section in Chapter 9 for more information.

4. In the Text Options area, specify the Justification, Text Style, Height, and Rotation.

The text properties for attribute definitions are the same as those for single-line text objects — see Chapter 9.

5. Choose the Pick Point button and choose an insertion point for the attribute definition.

An attribute definition’s insertion point is like a text string’s base point. Remember to use snap, object snap, or another precision tool if you want the eventual attribute values to be located at a precise point.

6. Click OK to create the attribute definition.

7. Repeat Steps 1 through 6 for any additional attribute definitions.

  If you need to create a series of similar attribute definitions, create the first one using Steps 1 through 6. Then copy the first attribute definition and edit the copy with the Properties palette.

Block definition containing attribute definitions

After you create one or more attribute definitions — and any other geometry that you want to include in the block — you’re ready to create a block definition that contains them. Follow the steps in the section, “Creating block definitions,” earlier in this chapter. At Step 4 in the section, “Creating block definitions,” select any attribute definitions first before you select the other geometry. Select each attribute definition one-by-one (clicking on each attribute definition rather than selecting multiple attributes with a selection window), in the order that you want the attribute value prompts to appear in the Enter/Edit Attributes dialog box (see Figure 13-5). If you don’t select the attributes one by one, your block and attributes will still work, but the order of the attribute prompts in the Enter/Edit Attributes dialog box may not be what you want.

Figure 13-5: The Enter Attributes dialog box.

  You can use the Block Attribute Manager (choose Modify>Object>Attribute>Block Attribute Manager) to reorder the attribute definitions in a block definition. You also can use this dialog box to edit other attribute definition settings, such as the prompt, text style, or layer. If you get tired of traversing four menu picks to get to this command, you can type the command name — BATTMAN (Block ATTribute MANager) — instead. I suppose it’s only a matter of time before Autodesk adds a ROBIN (ReOrder Block INsert) command…

  Attributes are particularly useful for creating a title block. Use regular AutoCAD commands, including mText or TEXT, to draw the parts of the title block that will remain the same in all drawings. Then use ATTDEF to create an attribute for each text string in the drawing that might change on different sheets.

Insert a block containing attribute definitions

After you create a block definition that contains attribute definitions, you insert it just like any other block. Follow the steps in the section, “Inserting blocks,” earlier in this chapter. At the end of the steps, AutoCAD should display the Enter Attributes dialog box, shown in Figure 13-5. The dialog box contains one row for each of the attribute definitions and has any default values filled in. You simply edit the values and then click OK.

  The ATTDIA (ATTribute DIAlog box) system variable controls whether AutoCAD prompts for attribute values in a dialog box (ATTDIA=1) or at the command line (ATTDIA=0). If you insert a block and see command line prompts for each attribute value, type a value and press Enter for each attribute value. When you return to the Command: prompt, type ATTDIA, press Enter, type 1, and press Enter again. When you insert blocks with attributes in this drawing in the future, AutoCAD displays the Edit Attributes dialog box instead of prompting you at the command line.

Edit attribute values

After you insert a block that contains attributes, you can edit the individual attributes in that block insert with the EATTEDIT command (Enhanced ATTtribute EDIT — nothing to do with eating). Choose Modify>Object>Attribute>Single and click on any object in the block insert. AutoCAD displays the Enhanced Attribute Editor dialog box with the current attribute values, as shown in Figure 13-6. The most common attribute editing operation is to edit the text value — that is, the text string that appears in the block insert. You also can change properties of the attributes, such as layer and text style.

Figure 13-6: The Enhanced Attribute Editor dialog box.

  Many people use attributes in the way I’ve described so far — as fill-in- the-blank text fields in blocks. But attributes also can serve as data extraction tools. For example, you can export attribute values, such as part numbers and quantities, to a text, spreadsheet, or database file for analysis or reporting. The Attribute Extraction wizard (Tools>Attribute Extraction) makes the process fairly straightforward. If you’re hungry to find out more, look up “EATTEXT (Enhanced ATTribute EXTtract) command” in the AutoCAD online help system.

Exploding blocks

The objects in each block insert act like a well-honed marching squadron: If you move or otherwise edit one object in the block insert, all objects move or change in the same way. Usually this cohesion is an advantage, but occasionally you need to break up the squadron in order to modify one object without affecting the others.

To explode a block insert into individual objects, click Explode (the firecracker button) on the Edit toolbar and then select the block insert. When you explode a block insert, AutoCAD replaces it with all the objects — lines, polylines, arcs, and so on — specified in the block definition. You then can edit the objects or perhaps use them to make more block definitions.

  Don’t make a habit of exploding blocks cavalierly, especially if you’re working in someone else’s drawing and aren’t sure why the objects are organized as blocks. Most people use blocks for a reason, and if you go around exploding them left and right, you’re likely to be treated the same way that anyone who blows up a lot of things gets treated.

Purging unused block definitions
Вы читаете AutoCAD 2005 for Dummies
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату