Adding Intelligence to Drawing Using Fields in AutoCAD

Fields are a dynamic piece of text information that updates itself depending upon the context and its use. A simple example of a field is a sheet number used in the title block of a sheet.This information can be added using fields in such a way that if a sheet number changes, the corresponding value will update itself automatically in the title block as well. Fields can be used in a variety of situations, and in this article, I will show you a method of creating and entering fields in a variety of situations.

Creating Text Style for Field

Fields are text information, and they take properties of current text style. So it is always good to create a text style in which you want your field to appear. For creating a text style, type “ST” and press Enter. From the Text Style window, click on the New button and give your text style a name. Change the font to Simplex.shx font, change other parameters as well if required and click on Apply and then the Close button. Set this text style as current, and we are ready to add fields in the drawing with a new text style.

Using Fields to Show Area

Fields can be used to show the area of a region.The distinct advantage of using fields is its ability to update itself if the geometry is changed. Let's take the example of a simple rectangle.

To enter the area field for a rectangle, type “FIELD” on the command line and press Enter. Alternatively, you can also select the Field option from the Data panel in the Insert tab. From the Field Category drop-down menu of the Field window, select Objects and click on the Object in Field Names panel. Click on the small box next to the Object type field and the field will disappear momentarily, allowing you to select objects from the drawing area. Click on the rectangle from the drawing area. In the Property panel of the Field window, you will notice a list of all properties related to the rectangle. Select Area from this list and select Format in the next panel. This is shown in Figure 1 below.

Figure 1. Selecting Area field from the Field window.

Once you have made your selection, click on OK and place the field inside the rectangle. The field will appear with a gray background (Figure 2), which gives it a distinct look. This gray background can be used to identify the field from the simple text in the drawing. The printout of the field will appear like a simple text with no background color.

Figure 2. An area field is shown with a gray background.

To check if this field works properly, change the area of the rectangle by moving its sides or vertices and then type “RE” and press Enter. This will regenerate the entire drawing area, and you will get an updated area in the field.

Using Fields in AutoCAD Table

Fields can also be added in many other situations, for example, in a table where a field can be used to show the sum of values in a column or an average. To use a field in a table, I will create a table representing a marks statement of six students as shown in Figure 3.

Figure 3. Marks statement table of six students.

We can add the value of total marks using field so that if marks of any student are changed then the total value will also change automatically. To do that, click in the last cell of the marks column and click on the Field icon from the Insert panel of the Table Cell tab. Select Formula from the Field names panel of the Field window and click on the Sum button.

The Field table will disappear for a moment, allowing you to select the cells for which you want to use the formula. Click on the cell containing marks of student 1, which is 67, and then click on the cell containing marks of student 6, which is 89. The table will appear again, and from the Format panel, select Decimal and change the precision to 0 from the precision drop-down menu. Click on the OK button to enter the field in the selected cell.

You will notice that the total marks value will be added to the selected cell, and in this case, the value will also be shown with a gray background, indicating that it's a field. You can change the marks of any student and regenerate the drawing using the RE command to see that total marks change automatically.

Using Field in Block Attribute

A field can also be used in a block attribute to show some specific information. A simple example of an attribute used in a block is a title block, in which information like sheet number, scale, date and company name can be inserted using fields. As an example, I will make a simple title block with the drawing name and sheet number mentioned in it. I will take the example of the geometry shown in Figure 4.

Figure 4. A simple geometry for creating a title block.

Type “B” and press Enter to open the block definition window.Give this block a name. I'll name it “Title Block.” Now click on the Pick point button and select the lower-left point of the block. Click on the Select objects button, select the complete geometry shown above and press Enter. Make sure the“Allow exploding” and “Open in block editor” radio buttons are checked and then click on the OK button.

The block will open in the block editor window, where we can add fields in the form of block attributes. Click on the Attribute Definition button in the Action parameters panel of the Block Editor tab. A new Attribute Definition window will open.Enter the tag and prompt values in the respective fields. I am entering “DNAM” as the tag and “Drawing name” as the prompt. In the default section,click on the Insert field box and select Filename from the Field Names panel. Now click on the“Filename only” radio button and click on OK. Specify other settings in the Text Settings panel and click on OK. Click in the empty place of the title block to place the field. Repeat this process to enter the sheet number field in the block. Now save all changes and close the block editor.

Now create a new layout view.Enter this title block and use this layout in a sheet set. After naming the drawing and giving the sheet number, you will notice that fields in the title block will update themselves. In Figure 5, the first field represents the drawing name, whereas the second field represents the sheet number in the title block. These fields will get further updated if a change is made in drawing name or sheet number.

Figure 5. Drawing name and sheet number field used in the title block.

Conclusion

Fields are effective ways of adding intelligence to the drawing that help in automating some of the tasks that are prone to error, especially when changes are made in the drawing. Using fields is not limited to what is mentioned in the article.Other applications of fields include creating an intelligent template with fields and adding callout blocks in a sheet set.

How often do you use fields in your drawings? Let us know in the comments section below.