监控系统变量的变化



程序代码:

<CommandMethod("VariableChanged")> _
        Public Sub VariableChanged()
            AddHandler Application.SystemVariableChanged, New Autodesk.AutoCAD.ApplicationServices.SystemVariableChangedEventHandler(AddressOf SystemVariableChanged)
        End Sub
        Private Sub SystemVariableChanged(ByVal sender As Object, ByVal e As Autodesk.AutoCAD.ApplicationServices.SystemVariableChangedEventArgs)
            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            doc.Editor.WriteMessage("变量名称: {0}" & vbLf, e.Name)
            If e.Name = "WSCURRENT" Then
              ‘’
            End If
        End Sub




判断模型空间还是图纸空间



欢迎关注微信公众账号ByCAD