Event not working

Event not working

erik_kohl
Contributor Contributor
312 Views
0 Replies
Message 1 of 1

Event not working

erik_kohl
Contributor
Contributor

Hi everyone,

 

This event(from autocad help) works fine until i change to another layout.

Anyone knows how to solve this??

 

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices


Public Class Useri1Event
    <CommandMethod("AddAppEvent")> Public Sub AddAppEvent()
        AddHandler Application.SystemVariableChanged, AddressOf appSysVarChanged
    End Sub

    <CommandMethod("RemoveAppEvent")> Public Sub RemoveAppEvent()
        RemoveHandler Application.SystemVariableChanged, AddressOf appSysVarChanged
    End Sub

    Public Sub appSysVarChanged(ByVal senderObj As Object, ByVal sysVarChEvtArgs As Autodesk.AutoCAD.ApplicationServices.SystemVariabl​eChangedEventArgs)

        Dim oVal As Object = Application.GetSystemVariable(sysVarChEvtArgs.Name​)

        '' Display a message box with the system variable name and the new value
        Application.ShowAlertDialog(sysVarChEvtArgs.Name & " was changed." & vbLf & "New value: " & oVal.ToString())


        'End If

    End Sub

End Class

0 Likes
313 Views
0 Replies
Replies (0)