setenv (AutoLISP)

Sets a system environment variable to a specified value

Supported Platforms: Windows and Mac OS

Signature

(setenv varname value)
varname

Type: String

Name of the environment variable to be set. Environment variable names must be spelled and cased exactly as they are stored in the system registry.

value

Type: String

Value to set varname to.

Return Values

Type: String

Value provided with the value argument.

Examples

The following command sets the value of the MaxArray environment variable to 10000:

(setenv "MaxArray" "10000")
"10000"

Note that changes to settings might not take effect until the next time AutoCAD is started.