The code is nice, but the lisp problem remains, because each successive button I have to use ruins my settings the same way. There are a lot of buttons. I do feel a neccesity for event handling. I am aware of the adverse effects.
Here's one I put together for an osmode problem, but the clayer problem needs to know what to set it to, previous to the event.
Private Sub AcadDocument_EndLisp()
Dim sysVarName As String
Dim sysVarData As Variant
Dim DataType As Integer
Dim intData As Integer
sysVarName = "osmode"
intData = 6175
sysVarData = intData
ThisDrawing.SetVariable sysVarName, sysVarData
End Sub
Private Sub AcadDocument_LispCancelled()
Dim sysVarName As String
Dim sysVarData As Variant
Dim DataType As Integer
Dim intData As Integer
sysVarName = "osmode"
intData = 6175
sysVarData = intData
ThisDrawing.SetVariable sysVarName, sysVarData
End Sub
It's the BeginLisp that I don't quite have a handle on.