课程: AutoCAD 2023 Essential Training

Adding fields to a table

- [Instructor] Once again, we're staying in our simple objects .dwg file. And like I said in the previous videos, we've created our table style. We've brought our table into the drawing. And I mentioned about the data that we wanted to place in the table. So we've got these three cells now that represent the areas of each of our objects; our rectangle, our circle, and our hexagon. So what I can do now is I can double click in the cell here for the area for the rectangle. Just double click inside it and you'll see it kind of goes gray. But also remember, you've got the text editor that pops up on the ribbon at the top of the screen. When you're placing text into your tables in AutoCAD, it automatically uses mtext, multiline text. So you've got all of that plethora of editing tools on the ribbon at the top of the screen. We want one simple command. It's in the insert panel here. And we're going to click on field. So when I click on that, it brings up this great big dialogue box with loads of weird stuff on the left. You don't need to worry about any of that weird stuff at all because we're going to change our field category top left. Click there and select objects. Notice that list changes quite quickly. So what we're going to do, we're just going to come down to object, surprise, surprise. So we're in the objects category and we want to select an object. I'm now going to use this little box here. It's a little icon, select object. So I click, it takes me into the drawing, we're working with our rectangle, so get the pick box over the rectangle and click. It now gives me all of the properties of that particular polyline. It tells me it's a polyline, and I've got area, global width, the layer it's on and so on. So all of these properties here could become data fields in a table. We just want the area, like so, and the precision there, we're not going to worry about any decimal places, I just want a number without any decimal places like that. And we can change the additional format. We can have a conversion factor, we can have prefixes, suffixes, we can also suppress leading or trailing zeros as well. I'm not going to worry about any of that. I'm going to click on cancel and I'm just going to click on okay. And there's my area of my rectangle in square units. Let's go down one. If I go down one by using the down arrow like that, can you see you there? It now highlights the next cell down. So I'm going to do the same again. I'm going to go up here to the field in the insert panel. And again, it remembers this time what I've been doing. So all I've got to do is go over here to select object. We've already got the field category, objects, we've already got the field names for the object. So I just click on the select button, select my circle this time, and we want area again, and we're going to go decimal with no decimal places. I'll click on okay, and there's the information. Where did the table go? Don't worry about that. Just close the text editor and it will come back. Sometimes AutoCAD kind of hides the table, and it's one of those little freak out moments where you think, where did my table go? It's a graphics thing in AutoCAD. Don't worry about it. As soon as you close the text editor, the table comes back. So don't panic and start hitting escape to cancel the command. AutoCAD does that sometimes, even with the latest version of AutoCAD. It's a graphics thing. So last but not least, we go to the hexagon area cell. I'm going to double click in the cell this time and I'm going to right click this time, and you'll notice like an insert field on the shortcut menu as well. That does the same thing. There's our category, objects, there's our field name, object, click on the select objects button and we'll select our hexagon, like so. Again, there's the polyline, there's the area property, there's the preview. Everything we need is there. It's decimal, no decimal places. Click on okay, and there's our area in our table. Just click away from the table and we've now got an area for each of our objects in the table. Now here's the clever bit. If I change any of the geometry of those objects and I save the drawing, what'll happen is it will update the table. This is where it gets clever. So what I'm going to do is I'm going to click here on the rectangle, click on that little mid grip there and just drag the rectangle down a bit so it's a bit bigger. I'm then going to hit escape, and I'm going to select the circle, click on this little grip here, make the circle a little bit bigger, hit escape to deselect. Same with the hexagon. Click on one of the mid grips there and just drag it down and change the shape of it like that so it's sort of like a little cartoony coffin shape kind of thing. And then again, hit escape. Now I don't have to save the drawing, but if you do save it, that will update it, 'cause when you save, you regen the drawing anyway. So if I type regen and just press enter, my areas update. How cool is that? So any area data that I've got of say, rooms in a building or areas of phases of a construction project, if they get bigger or smaller, if I've got a boundary polyline going around them, I can add that area to a table. Quick and easy like that. It's a wonderful tool. Utilize that field data in your tables, it'll make your life so much easier.

内容