AutoCAD variables

Variables can be saved in the drawing file or in the system, they can affect a single file or all of them.

Here's a collection of the ones I keep watching.

Notice: some variables that keep multiple values use a system by wich the single values are added, often based on a binary code, e.g. OSMODE (the variable that keeps the current Osnaps setting) if set to 2^0=1 (endpoint) + 2^2=4 (center) + 2^5=32 (intersection) = 37 will snap to endpoints, centers and intersections.

I personally keep a menu with some variable switches ready for quick access, eg: turn on and off image frames.

Variable Sys/dwg Values Description
INSUNITS drawing 0 to 21 memorizes the current drawing units (meters, millimeters...)
FIELDEVAL drawing 0 to 31 when the field has to be updated (opening the file, regenareting, plotting…)
UCSFOLLOW drawing 0 or 1 changing UCS rotates the view keeping the axes parallel to the screen (1) just rotates the axes (0)
VISRETAIN drawing 0 or 1 resets or remembers modification to Xref's layer states
VISRETAINMODE system Bitcode Use this system variable in conjunction with the VISRETAIN system variable to control which xref layer properties that you want to automatically sync on reload