How to operate with fields in AutoCAD. Applying mathematical formulas

Fields in AutoCAD are dynamic data inside ordinary text objects.  They can show data from the drawing, objects and formulas. They can be easily identified because they display with gray background (although this background doesn't print).

This article focuses on an advance us of fields, explaining how formulas can be added to fields, allowing you to add areas, subtract lengths, multiply heights or divide volumes.

Let's suppose for example we want to multiply the area in a polyline by a number contained in a text. We would do the following:

1. Draw the polyline

2. Insert text MTEXT or TEXT with a number.

3. Open any text editor (NOTEPAD, WORD,...) and write the formula we'll need: POLYLINE*NUMBER (or P*L for short)

4. Insert text MTEXT or TEXT that will  que contendrá el contain the field with the formula. AutoCAD fields are very easy to include; just right-click while editing the text > Insert Field...

. On the left column, select Object > Object.

. Click on the icon with the arrow shape located at the top of the middle column (type of object)

. Select the Polyline

. Select the data we want to extract (Area in our case)

. Copy all the code in the lower gray box and replace the P in the formula from our text editor.

. Same with the multiplying value: Click on the arrow icon and select the text box.

. Select the Contents property.

. Copy all the code in the lower gray box and replace the N in the formula from our text editor.

. Select Formula in the left column of our Field dialog.

. Paste the complete from our text editor into the lower text box, after the after  = symbol, and accept. You've finished!

It is important to know that the data in a field will only update upon regeneration (REGEN and REGENALL) commands. You can't  update Fields automatically, for that you need to use Tags.
It is also interesting to know that copying the Fields and the linked contents at the same time will relink the new field with the new objects.