Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Книги_AutoCad_2 / AutoCAD 2006 and AutoCAD LT 2006 Bible_2004г__.pdf
Скачиваний:
142
Добавлен:
09.04.2015
Размер:
17.83 Mб
Скачать

340 Part II Drawing in Two Dimensions

13.Start the MTEXT command. At the prompts, define a border somewhere in the middle

of the drawing. The width should be equal to about three of the plats that you see at the top. Type Plat Acreage .

14.Type 1., press Tab, 22.93 . Be sure to insert a tab after the period. AutoCAD and AutoCAD LT automatically create a numbered list when you use this format. You should now see the number two with a period after it (2.).

15.Finish the rest of the numbered list as follows:

2.2.85

3.1.51

4.1.38

16.Click anywhere outside the In-Place Text Editor area to end the MTEXT command.

17.Choose Zoom Previous to return to your original view. Save your drawing.

Creating Tables

Tables, which are often called schedules, are very common in drawings. It seems that since the beginning of time, you had to build your own tables by drawing horizontal and vertical lines and fitting text in the resulting boxes. You can save your formatting in table styles for consistency among drawings. You should save table styles in your templates.

Inserting a table

To insert a table, choose Table from the Draw toolbar to start the TABLE command. The Insert Table dialog box opens, as shown in Figure 13-19.

Figure 13-19: Use the Insert Table dialog box to create a table in your drawing.

Chapter 13 Creating Text 341

On the left side of the Insert Table dialog box, you see a preview of how the table will look. By default, you see either the Standard table style or the last table style that you used. Choose the table style that you want from the Table Style name drop-down list. In the next section,

I explain how to define a table style.

In the Insertion Behavior section of the dialog box, choose from one of the following options:

Specify insertion point: You place the table in your drawing by specifying an insertion point. You use the Column & Row Settings section to specify the number of columns and their width, as well as the number of rows and their height (in terms of lines of text).

Specify window: You pick a point at the upper-left corner of the table and then move the mouse to specify the lower-right corner. You use the Column & Row Settings section to specify the number of columns and the line height of the rows. As you move the mouse to the right, the columns widen, and as you move the mouse downward, additional rows are added. Click when you see the size that you want.

 

If the table style shown is what you want, click OK. Then specify an insertion point or a win-

 

dow to place the table.

Cross-

 

You can also create a table using a table tool on a tool palette. For more information on tool

Reference

palettes, see Chapter 26.

 

 

 

Specifying a table style

 

You have a great deal of control over how your table looks. You can make it plain or fancy. To

 

design your table, you create a table style by choosing Format Table Style to open the Table

 

Style dialog box, shown in Figure 13-20.

Tip

You can also access the Table Style dialog box by clicking the Ellipsis button in the Table Style

 

Settings section of the Insert Table dialog box (see Figure 13-21).

Figure 13-20: The Table Style dialog box gives you the tools to create tables with style.

342 Part II Drawing in Two Dimensions

 

On the left side of the Table Style dialog box is a list of styles. From the List drop-down box,

 

you can choose to display all styles or only styles that are in use in your drawing. To make a

 

table style current, choose the style that you want and click Set Current.

Tip

An easier way to make a table style current is to choose the table style from the Table Style

 

drop-down list on the Styles toolbar. Choose your table style before you start to create a

 

table. You can also import table styles from the DesignCenter. (For more information on the

 

DesignCenter, see Chapter 26.)

 

To create a new style, click the New button. In the Create New Table Style dialog box, enter a

 

Name in the New Style Name text box. From the Start With drop-down list, choose an existing

 

table style as a basis for your new style. The new table style inherits the properties of this

 

existing style so that you have to specify only the differences that you want. Then click

 

Continue to open the New Table Style dialog box, as shown in Figure 13-21.

Figure 13-21: The New Table Style dialog box is the place to define a new table style.

As you define your new table style, the preview panel at the right shows you the results. In this dialog box, you use the various tabs to define the formatting for the data in the cells of the table, for column headings, and for the table’s main title. The three tabs are exactly the same, although they have slightly varying defaults. On the Column Heads tab, uncheck the Include Header Row check box if you don’t want to create column heads. On the Title tab, uncheck the Include Title Row check box if you don’t want a title cell. You can define your table style using the sections of the New Table Style dialog box.

Chapter 13 Creating Text 343

Cell properties

Choose a text style from the Text Style drop-down list. If you don’t have a suitable text style, click the ellipsis button to the right of the drop-down list to open the Text Style dialog box. You can then define a text style. When you’re done, close the Text Style dialog box and your new text style is available in the New Table Style dialog box.

Enter a text height in the Text Height box. Choose a text color from the Text Color drop-down list. The default is ByBlock, which means that the text color is the same as the actual table — which is a block. (I explain blocks and the ByBlock attribute in Chapter 18.) You can also choose ByLayer, which gives the text the properties of the current layer.

Use the Fill Color drop-down list to specify the background color of the cells. The default is None, which shows the background color of your drawing area.

Use the Alignment drop-down list to specify the text alignment within each cell. For example, you might want to use Middle Center for the title and column headings, and Middle Left for the data cells.

Border properties

Choose one of the border buttons to specify which borders you want to see. For example, for the data cells, if you choose Outside Borders, the data area of the table will not have any grid lines between the cells, only around the outside of the data cells.

Caution

If you inadvertently create a table style with only outside borders, you may not notice the

 

absence of borders in your drawing, where grid lines show between the cells so that you can

 

more easily fill in the table. Choose Plot Preview on the Standard toolbar to see the final

 

result more accurately.

Choose a grid lineweight from the Grid Lineweight drop-down list. For example, you may want a slightly thicker lineweight for the title cell. Then choose a color from the Grid Color dropdown list. If you leave the ByBlock default, the color will match the layer of the table.

General

In the General section, choose a direction for the table. The default direction is Down, where the table title is at the top, and you enter data from the top to the bottom. You can choose the Up direction, in which case the title is at the bottom of the table, and you enter data from the bottom to the top.

Cell margins

The cell margins are the space between the text and the cell borders. The horizontal margins affect the left and right sides of the text, while the vertical margins affect the top and bottom of the text. Enter a value in the Horizontal and Vertical text boxes.

When you’re done, click OK to return to the Table Style dialog box. Click Close to return to your drawing.

344 Part II Drawing in Two Dimensions

Entering data into a table

Tip

New

Feature

After you’ve placed a table, you can then enter data into the table. The cursor is automatically placed in the first cell, and you can just start typing. Press Tab to move to the next cell. Continue in this way until you have completed the table. Figure 13-22 shows an example of a table.

Figure 13-22: A nicely styled schedule of parts.

You can create a complete table on the fly by importing data from Microsoft Excel. Select the data in Excel and copy it to the Windows Clipboard. In AutoCAD, choose Edit Paste Special. In the Paste Special dialog box, choose AutoCAD Entities and click OK. At the prompt, pick an insertion point.

You can insert a field into any cell in a table. For more about fields, see the “Inserting Fields” section, later in this chapter. You can also insert blocks into a table. (I explain blocks in Chapter 18.) After you’ve finished entering text, click a blank cell to select that cell. Then right-click and choose Insert Block.

AutoCAD and AutoCAD LT now offer a spreadsheet-like capability in tables. You can insert formulas to add, average, and count. You can display the value of another cell or enter your own equation.

To enter a formula into a cell, follow these steps:

1.Select the cell.

2.Right-click and choose Insert Formula.

3.Choose one of the sub-options.

Sum: Adds rows or columns. At the Select first corner of table cell range: prompt, pick inside the first cell. At the Select second corner of table cell range: prompt, pick inside the last cell. You see the formula listed in the cell, for example, =Sum(C3:C5).

Average: Averages rows or columns. At the Select first corner of table cell range: prompt, pick inside the first cell. At the Select second corner of table cell range: prompt, pick inside the last cell. You see the formula listed in the cell, for example, =Average(C3:C5).

Chapter 13 Creating Text 345

Count: Counts the number of cells in a row or column. At the Select first corner of table cell range: prompt, pick inside the first cell. At the Select second corner of table cell range: prompt, pick inside the last cell. You see the formula listed in the cell, for example, =Count(C3:C5).

Cell: Displays the value of another cell. At the Select table cell: prompt, select the cell that you want to display. You see the formula listed in the cell, for example, =C3.

Equation: Lets you write your own equation. You just see an equal sign (=) in the cell. Enter the equation, for example =a3+b4.

Note To create equations, you use the same conventions as for spreadsheets. For example, you use an asterisk (*) for multiplication, a slash (/) for division, a caret (^) for powers, and sqrt for a square root.

You also see row headings (1,2,3, and so on) and column headings (A, B, C, and so on), so that you can easily figure out any cell’s address.

4. Press Enter to place the value of the formula.

Modifying a table

You may need to change the data in a table, or you may want to change the way the table looks. Either way, you can modify a table easily. However, you need to know some of the techniques involved, because tables in AutoCAD and AutoCAD LT are a little different from tables in your word processor.

Changing the text

Changing the text of a table is like changing any multiline text. Double-click the text inside a table, being sure not to double-click the grid lines. The In-Place Text Editor opens. You can use any of the techniques for editing text that I discuss in the “Editing paragraph text” section earlier in this chapter. You can change the properties of the text so that they don’t match the table style. For example, you can change the height or font of the text.

Changing table properties

You can also change properties of the actual table. If you double-click the table itself — that is, any of the grid lines — the Properties palette opens. Here, you can modify any conceivable table property, including its layer, its color, the number of rows or columns, or any of its style properties. If you want to revert to old-fashioned lines, you can explode the table. Of course, you can no longer edit the table as a table anymore; you just have lines and text.

To select the entire table, click any gridline of the table. You see grips at the corners of the table and at several other cell junctions. If you select the table and right-click, then you can use the shortcut menu to make additional changes to the table. For example, you can size columns or rows equally or remove property overrides. If you make a change to a cell, such as the cell’s alignment or color, you can use the Remove All Property Overrides item on the shortcut menu to change the cell’s properties back to match the rest of the table.

346 Part II Drawing in Two Dimensions

To select a cell, click inside that cell. You can then right-click and use the shortcut menu, which has the following items:

Cell Alignment: Changes the alignment of the text in the cell, using the standard textalignment options available for multiline text.

Cell Borders: Opens the Cell Border Properties dialog box, where you can specify border properties for that individual cell.

Match Cell: Matches cell properties. At the Select destination cell: prompt on the command line, pick another cell that you want to have the same properties. The prompt repeats until you press Enter.

Insert Block: Opens the Insert a Block in a Table Cell dialog box, where you can select the block that you want to insert, specify the block’s alignment in the cell, and set its scale and rotation angle. If you select the Autofit check box, the block is automatically scaled to fit the table cell.

Edit Field: Lets you edit a field. I discuss fields in the next section of this chapter.

Insert Formula: Lets you insert a formula, as previously explained.

Edit Cell Text: Opens the In-Place Text Editor so that you can edit text.

Insert Columns: Inserts a column. You can choose to insert the column to the right or to the left of the current cell’s column.

Delete Columns: Deletes the column that the current cell is in.

Size Columns Equally: Makes two or more columns that you select equally wide.

Insert Rows: Inserts a row. You can choose to insert the row above or below the current cell’s row.

Delete Rows: Deletes the row that the current cell is in.

Size Rows Equally: Makes all of your rows an equal height.

Remove All Property Overrides: Removes any formatting that you applied to the selected cell.

Delete Cell Contents: Deletes any text or block in the current cell.

Merge: Merges two or more cells together. You can choose to merge all of the selected cells into one cell, to merge them by row, or to merge them by column.

Unmerge Cells: Unmerges merged cells and recreates all of the original cells.

Properties: Opens the Properties palette so that you can change the cell’s properties.

You can select multiple cells and apply changes to those cells. To select multiple cells, use one of the following techniques:

Click inside one cell and drag over the other cells that you want to select. Release the mouse button at the last cell.

Click inside one cell, hold down Shift, and click inside the last cell that you want to select.

Tip

To enter the same text in multiple cells, select the cells. Then open the Properties palette

 

and enter the text in the Contents item. The text appears in all of the selected cells.

Chapter 13 Creating Text 347

When you select multiple cells, you can also merge the cells. Right-click and choose Merge Cells from the shortcut menu. By merging cells, you can create fairly complex table structures.

You can also edit tables using grips. To understand editing tables with grips, imagine that the left side of the table is the stable side, while the right side of the table is the flexible side. The top-left grip is the base point for the entire table. You can do the following edits with grips:

Upper-left grip: Moves the entire table.

Upper-right grip: Stretches the table horizontally. As you change the width of the table, the columns also stretch proportionally.

Lower-left grip: Stretches the table vertically. As you change the height of the table, the rows also stretch proportionally.

Lower-right grip: Stretches the table both vertically and horizontally. The columns and rows adjust proportionally.

Top-of-column grip: Adjusts the width of the column to the left of the grip. The entire table adjusts accordingly. If you press Ctrl while moving a column grip, the adjacent columns adjust, but the width of the table remains unchanged.

You can export a table to comma-delimited (.csv) format. You can then open the table data with a database or spreadsheet program. To export a table, follow these steps:

1.Select the table.

2.Right-click and choose Export.

3.In the Export Data dialog box, choose a name and location for the file.

4.Click Save.

On the

The drawing used in the following exercise on creating tables, ab13-05.dwg, is in the

CD-ROM

Results folder on the CD-ROM.

STEPS: Creating Tables

1.Open ab13-c.dwg from the CD-ROM. This is the same drawing used in the previous exercise.

2.Save the file as ab13-06.dwg in your AutoCAD Bible folder.

3.Choose Table from the Draw toolbar. In the Insert Table dialog box, click the Ellipsis button to the right of the Table Style Name drop-down list.

4.In the Table Style dialog box, click New. In the Create New Table Style dialog box, enter AcreageSchedule in the New Style Name text box. The Start With text box should read Standard. Click Continue. The New Table Style dialog box opens.

5.From the Text Style drop-down list, choose ROMANS. In the Text Height text box, enter 12.5. Because you want the numbers in the table to be right-aligned, choose Middle Right from the Alignment drop-down list. In the Cell Margins section, change both the Horizontal and Vertical text box values to 5.

6.Click the Column Heads tab. Make sure that the Include Header Row check box is checked. Again, set the Text Style to ROMANS and the Text Height to 12.5. Leave the alignment as Middle Center.

348 Part II Drawing in Two Dimensions

7.Click the Title tab. Make sure that the Include Title Row check box is checked. Make the following changes:

Text Style: ROMANT (for a different look).

Text Height: 13.5 to make the title text bigger than the rest of the table text.

Text Color: Click the Text Color drop-down list and choose Select Color. From the Select Color dialog box, choose the lightest gray color on the Index Color tab. Click OK to return to the New Table Style dialog box.

Fill Color: Click the Fill Color drop-down list and choose Blue.

Grid Color: In the Border Properties section, click the Grid Color drop-down list and choose Blue to match the fill.

8.Click OK to return to the Table Style dialog box and click Set Current. Then click Close to return to the Insert Table dialog box.

9.In the Insertion Behavior section of the dialog box, make sure that the insertion behavior is set to Specify insertion point. In the Columns & Row Settings section, set the number of columns to 2 and the column width to 100. Set the number of data rows to 5. The row height should be 1. Then click OK.

10.In your drawing, pick an insertion point anywhere in the lower-right area of the drawing. The In-Place Text Editor opens. Because you need to zoom in first, click anywhere outside the editor and do a ZOOM Window around the table. Then double-click the table to open the In-Place Text Editor again with the cursor in the title cell.

Tip

To zoom in without exiting the In-Place Text Editor, you can use the wheel of your mouse (if

 

you have one). I explain how to zoom using the mouse wheel in “The ZOOM Command” in

 

Chapter 8.

11.Complete the data for the four plats as shown in Figure 13-23, pressing Tab to go from cell to cell.

12.Type Total in the last row. Right-click the cell and choose Justification Middle Left from the shortcut menu.

13.Click anywhere outside the In-Place Text Editor and then click the lower-right cell to select it. Right-click the cell and choose Insert Formula Sum from the shortcut menu.

14.At the Select first corner of table cell range: prompt, click anywhere inside cell B3. At the Select second corner of table cell range: prompt, click anywhere inside cell B6. Press Enter. Your table should look like Figure 13-23.

15.Save your drawing.

Соседние файлы в папке Книги_AutoCad_2