Check this out

 

Autocad Tutorials, Autocad 3D, Free Autocad Blocks

Autocad Tutorials, Autocad 3D, Free Autocad Blocks

Using Fields and Tables

Adding text to a set of drawings can become a large part of your work. You’ll find that you’re editing
notes and labels almost as frequently as you’re editing the graphics in your drawings. To make
some of those editing tasks easier, AutoCAD provides a few special text objects.
In this chapter, you’ll look at fields and tables, two features that can help automate some of the
more common tasks in AutoCAD. Fields are a special type of text that can automatically update to
reflect changes in the drawing. Tables are a tool that helps to automate the process of creating and
editing tables and schedules. Tables are a common part of technical drawings and are similar to
spreadsheets. In fact, AutoCAD tables behave much like spreadsheets with the capability of adding
formulas to cells.
You’ll start this chapter with an introduction to fields and then go on to learn about tables.
Toward the end, you’ll revisit fields to see how they can be used to add formulas to tables.

Topics in this chapter include the following:

Using Fields to Associate Text with Drawing Properties

Adding Tables to Your Drawing

Editing the Table Line Work

Adding Formulas to Cells

Importing and Exporting Tables

Creating Table Styles
Using Fields to Associate Text with Drawing Properties
The text labels you worked with in Chapter 10 are static and don’t change unless you edit them
by using the tools described there. Another type of text object, called a
field
, behaves in a more
dynamic way than the multiline text. A field can be linked to the properties of other objects and
updates 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.
Open the
11c-unit.dwg
file. This file is similar to the drawing you worked on in Chapter 10.
2.
Double-click the Kitchen text to highlight it and make it available for editing.
3.
Right-click the highlighted Kitchen text, and then choose Insert Field to open the Field
dialog box. A list to the left shows the types of fields available.



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 Block 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 lowercase
with a capital first letter, regardless of how the block name is actually spelled.
8.
Click OK to exit the Field dialog box; then, press↵
twice to return to the Command prompt.

When you return to the drawing, the text appears in a gray background. This tells you that the
text is a field rather than an Mtext or a Dtext object. The gray background is just a device to help youkeep track of field text; it doesn’t 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.
EnterRename↵at the Command prompt to open the Rename dialog box.
2.
Make sure Blocks is selected in the Named Objects list; then, select Kitchen from the Items
list. The wordKitchenappears in the Old Name input box near the bottom of the dialog box.
3.
EnterKitchenettein the input box just below the Old Name box; then, click the RenameTo 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.


3.
Double-click the Living Room text to open the Text Formatting toolbar.
4.
Highlight the text that reads
230 square feet.
Right-click the selected text, and choose Insert
Field from the shortcut menu.
5.
In 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.



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.


10.
Click OK. The field you just added appears in the drawing as the area of the rectangle.
11.
Click OK to close the Text Formatting toolbar.
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 they align with the bathroom wall. Remember to Shift+click to select multiple grips.


2.
Choose View Regen. The field you just added updates to reflect the new area of therectangle.
3.
After reviewing the results, close11c-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’re 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 the current layer, the drawing name, linetypes, and more. You can include Diesel
macros as part of fields. (You’ll learn about Diesel macros in Chapter 26.) 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 28.
For most of your work, the standard text objects will work just fine, but you may 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.
Adding Tables to Your Drawing
One of the more common text-related tasks you’ll do for your drawings is to create schedules, such
as door and window schedules or parts schedules. Such schedules are tables used to provide more
detailed information regarding the elements in your design.
In the past, AutoCAD users used Mtext or Dtext to create the text for schedules and then used
line-drawing tools to create the cells of the schedule. Since AutoCAD 2006, you can use tables to
help you generate schedules more quickly. Tables allow you to automatically format the columns
and rows of text in a way similar to spreadsheet programs.


Creating a Table
The first step in creating a table is to determine the number of rows and columns you want. Don’tworry if you aren’t certain of the exact number of rows and columns; you can add or subtract themat any time. In this exercise, you’ll create a table that contains 12 rows and 9 columns, as shown inFigure 11.1.
Start by creating the basic table layout:
1.
Choose File New, and use the standardAcad.dwtdrawing template.

2.
Click Table from the 2D Draw control panel, or choose Draw 
Table from the menu bar toopen the Insert Table dialog box.



3.
In the Column & Row Settings group, enter9for Columns and12 for Data Rows.
4.
Click OK. The dialog box closes, and the outline of a table follows your cursor.
5.
Position the table in the center of your drawing area, and click to place the table. The table
appears with a cursor in the top cell of the table. You also see the Text Formatting toolbar
above the table.
6.
EnterRoom Finish Schedule, and press
↵. The cursor moves to the next cell.
7.
Click OK to exit the Text Formatting toolbar.

Adding Cell Text
You’ve just created a table and added a title. Notice that the table actually contains 14 rows, including
the title row at the top and an additional row for the headings of each column. You can delete these
additional rows if you don’t need them, but for now, you’ll start to add some text to the table:
1.
Adjust your view so the table fills most of the drawing area.
2.
Double-click in the first cell at the top left, just below the Room Finish Schedule label. The
cell turns gray, and the Text Formatting toolbar opens. You also see labels across the top and
left side showing the row and column addresses.

3.
EnterNumberfor the room number column at the far left, and then press the Tab key toadvance to the next cell to the right.
4.
EnterRoom, and press the Tab key again.
5.
EnterFinish, and press the Tab key four times to advance four columns. You do this
because the Finish heading shown in Figure 11.1 has four columns under it: Floor, Base,
Walls, and Ceiling. In the next exercise, you’ll learn how to format those four columns
under the single heading.
6.
EnterCeiling Ht., and press the Tab key again.
7.
EnterArea, press the Tab key, and enterRemarks
.
8.
Click OK in the Text Formatting toolbar to close it.
You have the column headings in place. Now, you need to do a little extra formatting. In step 5,
you left four cells blank because four of the columns will be combined under one heading: The
Finish heading covers the Floor, Base, Walls, and Ceiling columns. Next, you’ll combine the blank
headings with the Finish heading:
1.
Click in the center of the cell with the Finish label to select it.
2.
Shift+click in the third cell to the right of the Finish cell to select all four cells.



3.
Right-click in the selected cells, and choose Merge All. The four selected cells merge intoa single cell with the wordFinish.Now, you need to add the subheads under the Finish header:
1.
Double-click in the leftmost cell below the Finish cell to open the Text Formatting toolbar.


2.
EnterFloor, and press the Tab key.
3.
EnterBase,Wall, andCeiling in each of the following columns as you’ve been doing.
Remember that the Tab key advances you to the next cell to the right. Your table should look
like Figure 11.2.
4.
Click OK in the Text Formatting toolbar to close it.