SetVariable Method

Back to Methods Reference

Sets the value of an AutoCAD system variable.

Signature

VBA : object.SetVariable Name, Value

VL : (vla-SetVariable Name Value)

(vla-SetVariable thisdrawing "OSMODE" 0)

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

  • Name : String; input-only
    The name of the system variable to set.

  • Value : Variant; input-only
    The new value for the specified system variable.

Remarks

When setting system variables, AutoCAD may require integers, text, or double values. Passing the wrong data type (for example, passing a variant of type double when an integer is required) will generate an error. The easiest way to avoid this is to explicitly type your data before passing it.

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

Example :


(defun c:al-setvariable ()

(vl-load-com)

(setq thisdrawing (vla-get-activedocument 
                      (vlax-get-acad-object)))

(vla-SetVariable thisdrawing "OSMODE" 0)

(princ)

);defun

 
The AutoLisp/Visual Lisp/VBA Resource Website
Google
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