Get variable "ORTHOMODE"

Please support me in getting the ORTHOMODE value in VBA, and to assign the value to a boolean variable.I tried with ThisDrawing.GetVariable "ORTHOMODE", but I couldn't assign it.I also declared a variable as AcadViewport.Thanks in advance,Claudia

Comments

  • ThisDrawing.SetVariable "orthomode", 1Is this what your looking for?Jerry

  • Ooops! your right. Dim ortmode as variant ortmode = ThisDrawing.Getvariable("Orthomode") returns 0 no matter the state.This is a question for support.Jerry

  • I disagree with Jerry when he says that .Getvariable("Orthomode") always returns 0You can set the ortho state via:ThisDrawing.SetVariable "ORTHOMODE", 0ThisDrawing.SetVariable "ORTHOMODE", 1I find the following works ok for me :'Option ExplicitSub main() UserForm1.Show vbModelessEnd Sub'Option ExplicitDim iOrhtoStatus As IntegerDim bOrthoIsOn As BooleanPrivate Sub cmdOrthoOFF_Click() ThisDrawing.SetVariable "ORTHOMODE", 0 iOrhtoStatus = ThisDrawing.GetVariable("ORTHOMODE") bOrthoIsOn = IIf(iOrhtoStatus = 1, True, False) Debug.Print "in sub cmdOrthoOFF_Click / bOrthoIsOn = " & bOrthoIsOnEnd SubPrivate Sub cmdOrthoON_Click() ThisDrawing.SetVariable "ORTHOMODE", 1 iOrhtoStatus = ThisDrawing.GetVariable("ORTHOMODE") bOrthoIsOn = IIf(iOrhtoStatus = 1, True, False) Debug.Print "in sub cmdOrthoON_Click / bOrthoIsOn = " & bOrthoIsOnEnd Sub

  • You are correct. It didn't work last night! Maybe I had a corrupt drawing open or two instances of V8. Code I used was..Sub ortmd()Dim ortmode As Variantortmode = ThisDrawing.GetVariable("Orthomode")MsgBox "Orthomode = " & ortmodeEnd Subwhich works in the session I am running. Since someone else had this problem, maybe it is intermittent.?Jerry

This discussion has been closed.