Join Shaun Bryant for an in-depth discussion in this video Using FIELDS in MTEXT, part of AutoCAD: Tips & Tricks.
- [Narrator] So here's another really neat tip and trick for AutoCAD. Now again, a really simple drawing. And the reason I'm making these tips and tricks nice and simple is so that I can demonstrate the concepts that you need to know. So you'll notice - really simple drawing. We've got a rectangle and we've got a circle, and we've got a bit of multiline text. Now, the lovely thing about multiline text is you can use symbols, so you'll notice there that I've got the millimeter squared because this drawing's in metric millimeters.
But also, you can insert what is known as fields into your multiline text. Now, the lovely thing about these fields is for example, the text says the area of the rectangle is such and such in amount of millimeters. The area of the circle is such and such in amount of millimeters. Now, the nice thing is is if change the areas of these and update my drawing, if that was field text in my multiline text, it would update automatically. And that's what I really love about fields and multiline text is you've got all the technology of the multiline text, things like symbols and the ability to make it bold, Italic and so on, but also more importantly, you've got the ability to update the data in the field in the multiline text.
So how does that work? Well, let's have a look. Let's just double click on the multiline text. That obviously allows us to edit it and you can see that the text editor tab comes up on the ribbon. So we've got all our tools there and I've put this on a nice simple font. You can see it there. It's the Verdana font and it's bilayer and the layer is a text layer in the drawing itself. Now, if I want to add a field, I can link my area of rectangle to the actual rectangle itself. So I highlight the text here, the XXXX like that and I go over here to the insert panel and there's a lovely field icon that I can just click on.
As soon as I click on that, the field dialogue box kicks in. Now, you've got to select your field category first. It's this one here. And in my case, it's going to be objects, objects in the drawing. So I click there, I've now got to specify the field name. Now, the field name will be the object itself so a rectangle is a close polygon in AutoCAD so I select object, object type. Why is it not telling me it's a polygon? Because I have to click here first, select the object then I come into the drawing area and pick on the rectangle itself like that.
Now I get all of the properties of that particular object type. Funnily enough, A for area, it's right there at the top. Now, the preview is giving me that lovely 3941.1525 millimeter squared. Now, that's all well and good, but I don't really need that particular type of precision so I change that here to no decimal places so it's now 3941 rounded millimeter squared.
So if I click on OK now, watch what happens. There's my 3941 and it's highlighted with a lovey gray background masking to let me know that it's a field. Now, here's the neat trick though. What I can do is go back in here, highlight this again like that, but for the circle, again click on field here and again it remembers now, field category objects, field name object, object type. So I click there, it's a different piece of text so I need to select a different object so I come here like that and click, there's my circle, there's my area.
Now, it's remembered the precision from last time so it's 1595 millimeter squared so all I've got to do now is click on OK and there's the two areas in place. If I click on Close here and Close the text editor, there they are there. Now, the text is a little bit bright sitting on that gray background, but that's not a major problem. We can easily just jump into the layers here and what I'll do now is I'll change the color of my M text layer. Let's make it a little bit darker, a little bit more subdued. Let's give it a nice purpley kind of color like that.
And as you can see now, that text is nice and easy to see on that gray background. So what happens now if I update these areas? So I'm gonna select the rectangle like that and all I'm going to do here is I'm going to change the size of the rectangle. Now, it's close polygon so it doesn't have to remain a rectangle either. I can click like this on the grip and just stretch like that and click like that and that changes the shape completely. It also changes the area.
I'll just hit Escape there like so and you'll notice the area hasn't updated yet in the text. If I come here like this, click on the circle, click on the grip just to drag up and change that radius a little like so and hit Escape, you'll notice the circle area hasn't updated. Now, what I could do here is I could save the drawing or I can type a lovely little command called regen, regenerates the drawing, press enter, watch the two areas, they both update automatically.
Isn't that lovely? So what those fields do in your multiline text is allow you to change the geometry but also more importantly update the area in the fields in the multiline text.
Skill Level Intermediate
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.