setvar

AutoCad AutoLISP Functions

 
setvar
 
 
 

Sets an AutoCAD system variable to a specified value

(setvar varname value) 

Arguments

varname

A string or symbol naming a variable.

value

An atom or expression whose evaluated result is to be assigned to varname. For system variables with integer values, the supplied value must be between -32,768 and +32,767.

Return Values

If successful, setvar returns value.

Examples

Set the AutoCAD fillet radius to 0.5 units:

Command: (setvar "FILLETRAD" 0.50)

0.5

Notes on Using setvar

Some AutoCAD commands obtain the values of system variables before issuing any prompts. If you use setvar to set a new value while a command is in progress, the new value might not take effect until the next AutoCAD command.

When using the setvar function to change the AutoCAD system variable ANGBASE, the value argument is interpreted as radians. This differs from the AutoCAD SETVAR command in the Command Reference, which interprets this argument as degrees. When using the setvar function to change the AutoCAD system variable SNAPANG, the value argument is interpreted as radians relative to the AutoCAD default direction for angle 0, which is east or 3 o'clock. This also differs from the SETVAR command, which interprets this argument as degrees relative to the ANGBASE setting.

NoteThe UNDO command does not undo changes made to the CVPORT system variable by the setvar function.

You can find a list of the current AutoCAD system variables in the Command Reference.

See Also