Function Entry: SETVAR
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: SETVAR
Name
setvar
Class
Host Interaction Function
Syntax
(setvar varname value)
Arguments and Values
varname: system-variable name designatorvalue: new value
Autodesk documents:
varnameas a stringvalueas an integer, real, string, list, T, or nil
Description
Sets an AutoCAD system variable to a specified value.
The per-sysvar entries in §16 System Variables document every
varname recognized by AutoCAD 2026 or BricsCAD V25, with the
declared type, default, read-only flag, scope, accepted-value
range, vendor divergence, and source URLs. The normative rules at
the head of that chapter (name case-insensitivity, integer
clamping to [-32768, +32767], type-coercion policy, read-only
error behaviour, angular-units convention for ANGBASE /
SNAPANG) apply uniformly to every setvar call.
Return Values
Returns value if successful.
Side Effects
Mutates host drawing/session state.
Exceptional Situations
Errors if the variable is read-only, absent, or rejects the supplied value.
Availability
- AutoCAD 2026: documented (per Autodesk reference page).
- BricsCAD V26: presumed compatible (no contradicting page found).
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
- [setvar (AutoLISP)](https://help.autodesk.com/cloudhelp/2026/HUN/AutoCAD-AutoLISP-Reference/files/GUID-B1CE1BFB-2448-47F1-95EC-10E9509F01FA.htm)
- [About System and Environment Variables (AutoLISP)](https://help.autodesk.com/cloudhelp/2026/JPN/AutoCAD-MAC-AutoLisp/files/GUID-529819FD-9E9C-4789-BA18-B981BA32DD23.htm)
- See §16
System Variablesfor the per-name catalogue and normative rules.
Notes
- Autodesk documents that for integer-valued system variables the supplied value must lie between
-32768and+32767. - Autodesk documents that changes made with
setvarduring an active command may not take effect until the next command. - Autodesk documents special angular semantics for
ANGBASEandSNAPANG:setvarinterprets the values in radians, unlike the interactiveSETVARcommand.
Compatibility
Supported on Windows, macOS, and Web in current Autodesk documentation.