Tuesday, 3 March 2015

AutoCAD: Using Fields to display VP Scale



At times despite our most diligent efforts, we inadvertently change the VP scale of a viewport, and end up with a plot that has an incorrect viewport scale.  With all of the tools available, there surely is a way to have AutoCAD display the viewport scale dynamically. Advanced users with programming expertise could do this programmatically using LISP and reactors, but there is also a much simpler solution: AutoCAD fields.  Here is a  great way to dynamically display your VP scale, using fields in mtext.

A field is a text representation of a specific object property or value of a drawing or system variable. Fields appear as normal text when plotted, but have a grey background onscreen, like this. The big difference between text and fields is a field will update if the element it references is changed. 


Some examples of field variables are: drawing name, login name, date, time, layout name. Fields can also display object properties such as object name, layer, color, linetype, and specific properties such as block name for blocks, center point of circles and arcs, or area of a polyline, or SCALE OF A VIEWPORT!

For this you will first need a viewport in your layout to assign the mtext field.  The next step is to create an mtext object, a good location is in one of the corners, perhaps lower left or lower right, either inside or outside. You can create some descriptive text as well, like "VIEWPORT SCALE ", and in the mtext editor right-click and select Insert Field... from the context menu; the Field dialog will appear. 


In the Field dialog, select the following
(as shown in the graphics):

Field category: Objects,
Field names: Object,
Object  type: Viewport, (to acquire the viewport, click the select objects icon to the top right of the Object Type area, and then select the viewport object
Property: Custom scale,
Format: Use scale name.  




AutoCAD will display the annotation scale (if applied) or the value of the VPSCALE variable. 


Since fields are dynamic, the dynamic scale will refresh with every open, save, plot, etransmit or regen (If this is not happening, set FIELDEVAL to 31).  If you wish to see it but not print it, place the mtext field on a non-plotting layer.  There you have it: a dynamic VPSCALE display!