嗨,当我关闭ACAD时,我试图切换我当前的活动工作区,但是,我得到了一个错误;无法获取文档对象
有人知道解决方法吗
谢谢Mark
- Private Sub ACADApp_BeginQuit(Cancel As Boolean)
- Dim CurrSysVarData As Variant
- Dim SysVarName As String
- Dim NewSysVarData As String
-
- SysVarName = "WSCURRENT"
- CurrSysVarData = ThisDrawing.GetVariable(SysVarName)
- NewSysVarData = "Exit"
-
- If CurrSysVarData "Exit" Then
- ThisDrawing.SetVariable SysVarName, NewSysVarData
- If MsgBox("Would you like to save this drawing?", vbYesNo) = vbYes Then
- ThisDrawing.Save
- Application.Quit
- Else
- Application.Quit
- Exit Sub
- End If
- End If
- End Sub
|