GetVariable Method

Back to Methods Reference

Gets the current setting of an AutoCAD system variable.


VBA : RetVal = object.GetVariable(Name)

VL : RetVal = (vla-GetVariable object Name)

(vla-GetVariable thisdrawing "OSMODE")

  • Object : Document
    The object or objects this method applies to.

  • Name : String; input-only
    The name of the variable to return. Must contain a valid system variable name (the case of the characters is not significant).

  • RetVal : Variant
    The value of the specified system variable.


For a list of all the AutoCAD system variables and their types, please refer to System Variables.

Example :

(defun c:al-getvar ()


(setq thisdrawing (vla-get-activedocument 

(setq thevar (vla-GetVariable thisdrawing "OSMODE"))

(princ thevar)



The AutoLisp/Visual Lisp/VBA Resource Website
Search the WWW Search AfraLisp

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website