Using Fields to Associate Text with Drawing Properties


The text labels you've been working with so far are static and do not change unless you edit them by using the tools described in this chapter. There is another type of text object, called a field, that can display drawing properties; this text will update itself automatically as the associated properties change. For example, you can create a field that is associated with a block name. If the block name changes, the field text automatically changes as well.

Try the following exercise to see how this works:

  1.  On the CD       Open the 08c-unit.dwg file from the companion CD. This file is similar to the drawing you've been working on in this chapter.

  2. Double-click the Kitchen text. The Edit Text dialog box appears.

  3. Right-click the highlighted Kitchen text and then select Insert Field. The Field dialog box appears. You see a list to the left that shows the types of fields available.

    click to expand
    start sidebar
    Keeping Text from Mirroring

    At times you will want to mirror a group of objects that contain some text. This operation causes the mirrored text to appear backward. You can change a setting in AutoCAD to make the text read normally, even when it is mirrored:

    Now, any mirrored text that is not in a block will read normally. The text's position, however, will still be mirrored, as shown in the following graphic. Mirrtext is set to 0 by default.

    click to expand
    end sidebar
     
  4. In the Field Category drop-down list, select Objects. This limits the display of field types to object fields.

  5. In the Field Names list, select NamedObject.

  6. Make sure that Blocks is selected in the Named Object Type drop-down list in the top of the dialog box; then select Kitchen. This associates the field with the Kitchen block name.

  7. In the Format list to the far right, select First Capital. This causes the field text to be lower- case with a capital first letter, regardless of how the block name is actually spelled.

  8. Click OK to exit the Field dialog box; then click OK at the Edit Text dialog box.

When you return to the drawing, you will see that the text appears in a gray background. This tells you that the text is a field rather than an Mtext or Dtext object. The gray background is just a device to help you keep track of field text and will not plot.

You've converted existing text into a field that is linked to a block name. Now let's see how the field works:

  1. Enter Rename at the command prompt to open the Rename dialog box.

  2. Make sure Block is selected in the Named Objects list; then select Kitchen from the Items list. The word Kitchen appears in the Old Name input box near the bottom of the dialog box.

  3. Enter Kitchenette in the input box just below the Old Name box; then click the Rename To button.

  4. Click OK to close the Rename dialog box.

  5. Choose View   Regen. The field you created changes to reflect the new block name.

Fields can be associated with a wide variety of properties. You've just seen how a block name can be associated with a field. In this exercise, you'll use a field to display the area of an object:

  1. Choose View   Zoom   Extents to view the entire plan.

  2. Place a rectangle in the living room area so that it fills the area.

    click to expand
  3. Double-click the Living Room text to open the Text Formatting dialog box.

  4. Highlight the text that reads 230 square feet, and then right-click the selected text and select Insert Field from the shortcut menu.

  5. At the Field dialog box, select Object from the Field Names list.

  6. Click the Select Object button next to the Object Type input box at the top of the Field dialog box. The Field dialog box momentarily closes to enable you to select an object.

    click to expand
  7. Select the rectangle you just added. The Field dialog box returns.

  8. In the Property list just below the Object Type input box, select Area.

  9. Select Architectural from the Format list to the far right.

    click to expand
  10. Click OK. The field you just added appears in the drawing as the area of the rectangle.

Next you'll alter the rectangle to see how it affects the field:

  1. Click the rectangle to expose its grips. Then select the top two grips and move them upward so that they align with the bathroom wall. Remember to Shift+click to select multiple grips.

    click to expand
  2. Choose View   Regen. The field you just added updates to reflect the new area of the rectangle.

  3. After reviewing the results, close 08c-unit.dwg .

    Tip  

    In previous exercises in this section, you changed existing text into fields. You can create new fields in either the Dtext or Mtext command by selecting Insert Field from the shortcut menu whenever you are typing the text content.

In this exercise, you used a rectangle, but you can use any closed polygon to create an area field. You've touched on just two of the many possible uses for fields. You can associate other types of properties including current layer, drawing name, line types, and more. You can include Diesel macros as part of fields (you'll learn about Diesel macros in Chapter 20). Fields can also be used in AutoCAD's Table feature, described in the next section, which enables you to quickly create tables and schedules. Fields are used to coordinate sheet labels with reference symbols in the AutoCAD Sheet Set feature described in Chapter 22.

For most of your work, the standard text objects will work just fine, but you might find fields useful when you know a label has to be associated with specific types of data in your drawing. In later chapters, you'll have more opportunities to work with fields.




Mastering AutoCAD 2005 and AutoCAD LT 2005
Mastering AutoCAD 2005 and AutoCAD LT 2005
ISBN: 0782143407
EAN: 2147483647
Year: 2004
Pages: 261
Authors: George Omura

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net