Join Shaun Bryant for an in-depth discussion in this video Adding fields to a table, part of AutoCAD 2018 Essential Training.
- [Voiceover] In the previous video we set up our table style and designed our table, and we brought it in like so. Now what we've got in this drawing is we've got our table as we set up previously with the polyline number, polyline layer, and polyline area columns, but I've also brought in two polylines. We have a rectangular polyline, which is on the polylines layer, and a hexagonal polyline, which again is on the polylines layer. Now what we want to do is we want to add the information from the polylines to the table.
You do that by way of utilizing fields in AutoCAD. So, for polygon number one, or polyline number one, it's still a polygon at the end of the day, a four-sided polygon, I want the layer and area information from that rectangle to go into the table. So I double click in the polyline layer cell here like that. Now that cell is now highlighted. You can see that the ribbon has changed to the text editor, and in the Insert panel, I've got a Field option. So if I click there like that, that will open up the Field dialogue box.
Now, the default setting is this one, All. So this is what you'll see first. You then change your category here in this pull down to Objects. Select Object in the Field Names column, like that. Then you need to go and click on this button here to select the object you want to work with. So I click here. Using the pick box now, I pick the rectangle and left click on it. So I now get all of this information about my polyline. So I've got Area, Layer, Linetype, and so on. I want Layer, so there's my polylines layer.
I can change what I want it to look like. Title case, First capital, Lowercase, or Uppercase. I'm going to select Uppercase. As soon as I click on Ok, you'll see that it adds that polylines field. So if I click there now away from the table, that is a field. If I change the layer of that polyline, it will update here and I'll show you how that works in a moment. We now need the area of the rectangle. So we double click in this cell, like so. Now, I can just right click and on the shortcut menu, Insert Field as well there, like that.
So again, it's remembered the object setting which is great. So I go to Select Object and select the rectangle again. This time I select Area at the top of the list. I can set it to Current Units which is the default. You can see that we've got 1533.8505 in the preview box. Am I actually worried about .8505 of a square millimeter, because I'm working in a millimeters drawing. Not really, so let's set that to decimal and change the precision there to say, zero, no decimal places.
Just rounds it up the nearest square millimeter. Now you do have additional formatting. There's the current value, there's the preview. I can convert it, I can add a prefix, I can add a suffix, and so on. Now the good thing is I could change the suffix there to millimeters squared if I wanted to. I could add a number separator for thousands, like a comma for example, and I can also suppress any leading or trailing zeros. I'm not going to do that. I'm going to click on Cancel, but just so you know it's there, because you can tweak the field settings in your table that way.
So I'm happy with that. I click on Ok and there's my polyline area. Now, obviously that's 1534 square millimeters. You might want to change your polyline area header. So just double click in there like so, click there, and maybe just (sq.mm) like that, and then just click away from the table so that you know it's square millimeters in that column. Then what we're going to do is work with the hexagon below. So it's the same process. I double click in this field here, like so.
I then right click or go to the ribbon, Insert Field. It remembers the object setting. I click on Select Object, like so. What I do is I select the hexagon. I select the layer. It remembers all the settings. There's the preview polylines. I click on Ok. I then click away from the table to deactivate that cell. I then double click on the area cell below the rectangle one. Again, activate it. I can click on Field in the ribbon if I want to. Again, it remembers the object settings.
Click on Select Object and I select the hexagon this time. I now select Area. It's remembered the precision and everything, and the settings, 779 square millimeters. I click on Ok. Click away from the table to deactivate the cell. Now, here's the really neat trick, if I change the geometry of my rectangle, I click on it, click on that grip there. Just drag it vertically up with the polar tracking to about there. It doesn't have to be exact. Hit Escape to deselect it. Now, that area value is now different to what is in the cell there, in the field area.
If I now move into the drawing area, and type Regen like so, that will regenerate the drawing. You call also save the drawing. That will regenerate it. Save the drawing, close the drawing, open it. That will also regenerate it, but you can just type Regen. Watch that polyline area of 1534. When I press Enter, it updates to the new value. How neat is that? So if I change geometry of any objects that are linked to my fields, to my table, it updates. That's really, really useful.
So I can edit geometry at any time and the table will always be current. Last but not least, we have a total area field here. So I need to do total area just here. What I'm going to do is just hover over the table, click and drag over the cells that you want to add up, like that. You'll notice it goes a weird yellow, and you've now got a pinky, sort of purpley color on the ribbon. You've now got all of your table cell editing tools. So what I can do now is I can insert above and below. I can go to Data Format, like that.
I can also insert information such as a formula. So if I do that and say that I want to add those up like that, I can add a sum. So I edit the first corner of the table cell range. I've done that, so I click in here now, and it adds them up. Can you see? So I've got a sum of all of them there. Now I want it in this one down here. I don't want it in there. So I'm going to hit Escape a couple of times, because what I need to do is not select them all first.
What I need to do is just click on the cell once. So again, it's one of those little workflow things. You automatically think, I'm going to select all of those, and add them up and drop it in there. It doesn't work that way. You set the formula up in the cell first and then select the cells you want to add up. It's just like Microsoft Excel if you've used it before. So now I go to Insert Formula again, like so. Click on the flyout and select Sum. Now it asks me for the table cell range. So now, here's where I click and drag, like that, and click again for the second time to select that range.
There's our range there, C3 - C6. There's the column C, there's 3, down to 6 on the rows. So now, all you've got to do is press Enter or Close, or even better, just click away from the table and it updates. You will have to edit the formatting. Can you see that, because it's taken the actual values. So you can go in and change that if you need to. You can go in and round it up like so, if you want to. Just change the settings, but what's really neat is that will now update if I change the area of this again.
So if I click here, just use a bit of object snap tracking. I'll hover over that one, just line that back in and bring it back to there like that. So the rectangle has changed shape and gone back to the original rectangular shape. Just hit Escape. If I come over here, just watch the polyline area column. I'll type Regen and press Enter. Everything updates, including the total where you put the sum in. So it's a really, really useful tool when you're adding fields to your AutoCAD tables.
- Exploring the user interface
- Using the ribbon, status bar, and ViewCube
- Opening, saving, and closing files
- Setting and converting drawing units
- Navigating drawings
- Saving and restoring views
- Drawing and modifying objects
- Drawing accurately
- Reusing content
- Creating output
- Using PDFs in AutoCAD