SysVarChanged Event (ActiveX)

Triggered when the value of a system variable is changed.

Supported platforms: Windows only

Signature

VBA:

object.SysVarChanged(SysVarName, NewVal)
object

Type: Application

An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

SysVarName

Type: String; input to the handler

The name of the system variable whose value has changed.

NewVal

Type: Variant; input to the handler

The new value of the system variable.

Remarks

This event indicates an attempt was made to change a system variable. It does not indicate the actual value was changed. In some cases, it is possible to set a system variable without causing its value to change. For example, if FILLMODE was 0 and someone tried to set it to 0, then you would get an event for that system variable even though the call had no actual effect on the value of FILLMODE.

No events will be fired while a modal dialog is being displayed.

Examples

VBA:

Public WithEvents ACADApp As AcadApplication    ' Use with Application Event Examples
Sub Example_AcadApplication_Events()
    ' This example intializes the public variable (ACADApp) which will be used
    ' to intercept AcadApplication Events
    '
    ' The VBA WithEvents statement makes it possible to intercept an generic object
    ' with the events associated with that object.
    '
    ' Before you will be able to trigger any of the AcadApplication events,
    ' you will first need to run this procedure.
    
    ' We could get the application from the ThisDocument object, but that would
    ' require having a drawing open, so we grab it from the system.
    Set ACADApp = GetObject(, "AutoCAD.Application.20")
End Sub

Private Sub ACADApp_SysVarChanged(ByVal SysvarName As String, ByVal newVal As Variant)
    ' This example intercepts an Application SysVarChanged event.
    '
    ' This event is triggered when the value of a system variable is changed.
    '
    ' To trigger this example event:
    '     1) Make sure to run the example that initializes
    '     the public variable (named ACADApp) linked to this event.
    '
    '     2) Change the value of a system variable in AutoCAD.
    '     For example: Type GRIDMODE on the command line and toggle the grid display on/off

    ' Use the "SysvarName" and "newVal" variables to determine which
    ' system variable has changed and its new value.
    MsgBox "The system variable " & SysvarName & " was just changed to: " & newVal
End Sub

Visual LISP:

Not available