Adjusting Table Text Orientation and Location
You now have the basic layout of the table, with one difference. The Floor, Base, Walls, and Ceiling
labels you just added are oriented horizontally, but you want them oriented vertically, as in Figure 11.1.The following steps will show you how to rotate a set of labels in a table so they appear in the orientation you want:
1.
Click in the cell labeled Floor to select it.
2.
Shift+click in the cell labeled Ceiling to select all four of the cells below the Finish heading.
The combined cells have four grips, one on each side of the group.
3.
Click the grip at the bottom of the selected group, and move it down about four rows. The
entire row becomes taller. This provides room for the text when you rotate it.
4.
Right-click in the selected cells, and choose Properties from the shortcut menu to open the
Properties palette.
5.
In the Properties palette, click the Text Rotation input box under the Content group.
6.
Enter90↵for a 90-degree rotation of the text. The text rotates into a vertical orientation.
7.
Close the Properties palette.
With the text in this orientation, the columns are too wide, so you’ll change the cell width for
the selected cells.
8.
Move the right grip to the left to decrease the width of the cells.
9.
For the final touch, you’ll center the text in the cells. With the cells still selected, right-click
in the selected cells, and choose Alignment Bottom Center. The text becomes centered in
the cells and aligned at the bottom of the cells.
TIP
You can also control the margin between the text and the cell border by using the Cell Margin
options in the Properties palette. Select the entire table, right-click, and choose Properties. In theProperties palette, click the Vertical Cell Margin option or the Horizontal Cell Margin option inthe Table group.
In the last exercise, you learned how you can adjust the text orientation through the Properties
palette. You can also adjust the width of multiple cells by adjusting the grip location. If you need
to be more precise about the cell width, you can use the Cell Width option in the Properties palettefor a set of cells.Now, continue to add text to the cells and adjust their sizes:
1.
Double-click in the cell in the Number column just below the row that contains the Floor,
Base, Walls, and Ceiling cells. A text cursor appears in the cell, and the Text Formatting toolbar
opens.
2.
Enter110, and press↵. Instead of advancing to the next cell to the right, you advance to thenext cell below.
3.
Enter 111, and press ↵ again. Continue to enter each room number in this way. When you’ve
finished entering the room numbers, click OK in the Text Formatting toolbar to close it.
Next, you’ll reduce the width of the column to fit the text a bit better.
4. Click in the cell with the Number text label. It’s the first column heading in the table.
5. Shift+click in the bottom cell of the Number column to select the entire column.
6. Click the grip to the left of the column, and move the grip to the right so the column width
is approximately half the width of the Room column. You can zoom in on the column to
allow more control over the positioning of the grip.
7. Press Esc to exit the selection and view your table so far.
Now, suppose you want to delete one of the extra rows of cells at the bottom of the table or add
a new row. Here’s what to do:
1. Click the bottom-left cell of the table to select it.
2. Right-click, and choose Rows Delete from the shortcut menu. The row disappears.
3. To add a row, select a cell, right-click, and choose Rows Insert Above or Rows Insert
Below, depending on where you want the new row.
You may notice the Delete Columns and Insert Columns options in the shortcut menu that let
you add or delete columns. These options function in a similar way to the Delete Rows and Insert
Rows options.
Editing the Table Line Work
So far, you’ve concentrated on how you can format text and cells in a table, but you’ll also want
some control over the lines in the table. Typically, heavier lines are used around the border of the
table and between the title and the rest of the table.
The Cell Borders shortcut menu option lets you modify the outline of the border. When you
select this option, the Cell Border Properties dialog box opens.
You can use this dialog box to fine-tune the appearance of the line work of the table. Try the following exercise to see firsthand how this dialog box works:
1. Turn on the display of lineweights by choosing Format Lineweight.
2. In the Lineweight Settings dialog box, turn on the Display Lineweight setting; then, click OK.
3. Click in the title cell at the top of the table to select the cell, and then right-click and choose
Borders to open the Cell Border Properties dialog box.
4. Click the Lineweight drop-down list, and select 0.30 mm.
5. Click the Outside Borders button in the Apply To group to tell AutoCAD to change the
borders of the cell to the selected lineweight.
6. Click OK. The title cell is now outlined in a heavier line. To see it clearly, press the Esc key
to close the Table toolbar.
You can also adjust the lineweights that encircle a group of cells, as in the following exercise:
1. Click the cell in the upper-left corner with the Number label.
2. Shift+click the cell in the lower-right corner of the table so that all the cells from the secondfrom-
the-top row down are selected.
3. Right-click, and choose Borders.
4. Select 0.30 mm from the Lineweight drop-down list. Then, click the Outside Borders button
as you did in step 5 of the previous exercise.
5. Click OK. The outlines of the selected cells are given the new lineweight setting.
6. Save this file for future reference.
TIP In addition to the table borders, you can change the background color for the cells of the
table through the Background Fill option in the Properties palette. Select a group of cells in
the table that you want to affect (but don’t select the entire table), right-click, and choose
Properties. In the Properties palette, click the Background Fill option in the Cell group.
The Cell Border Properties dialog box also lets you set the line colors by selecting a color from
the Color drop-down list before selecting an Apply To option.
In addition, the Apply To group offers four buttons: All Borders, Outside Borders (which you’ve
already tried), Inside Borders, and No Borders. The All Borders option applies the changes to all
borders. The Inside borders option applies the changes to just the inside borders. This option worksonly if you’ve selected multiple cells. The No Borders option lets you clear your border selectionsif you change your mind.
If you want to select only the vertical or horizontal inside borders, you can use the graphic in the
Cell Border Properties dialog box to select either the vertical or horizontal inside border. You can
also use the graphic to select individual sides of the outside border by clicking the sample border
in the graphic. The sample changes to show you which border lines are affected.
Adding Formulas to Cells
In the beginning of this chapter, I mentioned that you can include formulas in cells of AutoCAD
tables. This can be a great timesaver, because you can set up a table with quantities that automatically
adjust to changes in values in the table. You don’t have to manually calculate the changes.
You may recall that formulas are actually a type of field and that a field can be linked with
objects in a drawing so that the field displays the linked object’s properties. The formula field can
be linked to several numeric text values.
Although fields are the tool you use for formulas, you don’t have to consciously choose to add
a field to a cell every time you want to add a formula. The following exercise will demonstrate how
you can add a formula by typing directly in a cell. AutoCAD takes care of converting your input
into a field.
Using Formulas Directly in Cells
The simplest way to add a formula to a cell is to double-click the cell and then, when the Text Formatting
toolbar appears, enter the formula directly in the cell with the addition of an = (equal sign)
at the beginning. Try the following exercise to see how it works.
1. Open the FieldSample.dwg file.
2. Double-click in the cell, as shown in Figure 11.3, to select the location for your formula.
3. Enter the following text in the cell to add the values in cell A2 and cell D4:
=A2+D4
4. Press ↵ after you enter the value. The value of A2 plus D4 appears in the cell.
In step 3, the equal sign tells AutoCAD to convert the text into a formula field. You may have
noticed that when you start to edit a cell in a table, the row and column labels appear along the topand left side of the table. You can use these labels to determine the cell addresses for your formula.
In typical spreadsheet fashion, you can change the formula in a cell any time. Double-click the
cell containing the formula, and then edit the formula values and operators.
You can also use the Formula drop-down list from the Table toolbar to select from a set of
predefined math operations.
Click in the cell where you want to place the formula; then, in the Table toolbar, click the Formula
drop-down list, and select the operation you want to use. Next, place a selection window around the
cells you want to include in the formula. Click in the first cell that you want to include in the formula,
and then click in the second cell. As you do this, a selection window appears. All the cells that are
included in the selection window are included in the formula.
Using Other Math Operations
In the previous exercise, you used the plus sign to add the value of two cells. You can string
together several cells’ addresses to add multiple cells, as follows:
=A2+A3+A4...
You can also subtract, multiply, or divide by using the – (subtract or minus), * (multiply or asterisk),or / (divide or hash) sign. To perform multiple operations on several cells, you can group operationswith parentheses in a way similar to a typical spreadsheet formula. For example, if you want to add twocells together and then multiply their sum by another cell, use the following format:
=(A2+A3)*A4
The Average, Sum, and Count buttons that appear in the Formula drop-down list of the Table toolbargive you quick access to these frequently used functions. You can obtain the average value of a setof cells, quickly get the sum of a set of cells, or get a count of the number of cells you select. When youclick one of these options, you’re prompted to select several cells with a selection window. Onceyou’ve selected a set of cells, you see the appropriate formula in the selected cell. Clicking the Averagebutton, for example, produces a formula similar to the following:=Average(A1:B5)
Clicking the Sum button produces a formula like the following:=Sum(A1:B5)
In both cases, a range of cells is indicated using a colon, as in A1:B5. You can use this format whenentering formulas manually. You can also include a single cell with a range by using a comma:=Sum(A1:B5,C6)
Importing and Exporting Tables
Frequently, tables are created outside AutoCAD in a spreadsheet program such as Excel. You can
import an Excel worksheet as an AutoCAD table by using the AutoCAD Entities option in the Paste
Special feature. The ability to import tables lets non-AutoCAD users create the table data while you
concentrate on the drawing.
Try the following exercise to see how you can import a table from a worksheet:
1. Open the Excel worksheet called 11a-plan.xls, and highlight the door data, as shown in
Figure 11.4.
2. Choose Edit Copy to place a copy of the selected data into the Windows Clipboard; then,
switch back to AutoCAD.
3. Choose Edit Paste Special to open the Paste Special dialog box.
4. With the Paste radio button selected, click AutoCAD Entities in the list, and then click OK.
5. At the Specify insertion point or [paste as Text]: prompt, click a point in the lowerright
area of the drawing. The worksheet data appears in the drawing, although it’s very
small. You also see the Text Formatting toolbar.
6. Click OK in the Text Formatting toolbar to close it.
7. If needed, use the Scale tool to enlarge the table to a readable size.
In this exercise, you imported the worksheet by using the default standard table style. This givesyou a simple-looking table using the AutoCAD Txt font. You can set up a custom table style, asdescribed later in this chapter, with the fonts and borders you want, and then import the table fora more custom appearance. Make sure your custom table style is the current style before you
import the worksheet.
Exporting Tables
Some day, you might want to export your AutoCAD table to a spreadsheet program or database.
You can do this through a somewhat hidden option in a shortcut menu. Follow these steps:
1. Select the entire table. You can do so by clicking in a spot above and to the right of the table.
With the crossing selection window, completely enclose the table, and click.
2. Right-click anywhere in the table, and choose Export from the shortcut menu to open the
Export Data dialog box.
3. Specify a name and location for your exported table data, and click Save.
The file is saved with a .csv filename extension. This type of file is a comma-delimited file and
can be read by most spreadsheet programs, including Microsoft Excel. Unfortunately, the .csv file
doesn’t retain the AutoCAD table formatting.
To open the exported file from Excel, choose File Open in the Excel menu bar; then, in the
Open dialog box, select Text File (*.prn, *.txt, *.csv) in the Files Of Type drop-down list. You can
then locate the exported table and open it.
Adding Graphics to Table Cells
One of the more interesting features of the Table tool is its ability to include blocks in a cell. This can be
useful if you want to include graphic elements in your table. Adding a block to a cell is a simple process.
Here are the steps:
1. Click in a cell to select it.
2. Right-click, and choose Insert Block from the shortcut menu to open the Insert A Block In A Table
Cell dialog box.
3. Select a block name from the Name drop-down list. You can also click the button to the right of the
list to open a file dialog box that enables you to select a drawing file for import to the cell.
4. After you’ve selected a block and specified the settings in the Properties group of the dialog box,
click OK. The block appears in the cell you’ve selected.
The Properties group in the dialog box enables you to specify the alignment and size of the inserted
block. By default, the AutoFit option is turned on. This option adjusts the size of the block to make it fit
in the current cell size.