Matt, thanks, but aren't those bits for InitializeUserInput? I am trying to use an InputBox, and I cannot find any documentation on setting bits for its use.
MJF-The function of that box is part of a larger function to put in a block with elevation. I wrote a program to draw a Electricl Substation in 3d.
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public Sub AddPT()
Const VK_ESCAPE = &H1B
Const VK_LBUTTON = &H1
Const VK_SPACE = &H20
Const VK_RETURN = &HD
Const VK_LEFT = &H25
Dim inspt As Variant
Dim intOSMode As Integer
Dim dblRotation As Double
Dim objBlockRef As AcadBlockReference, dblTOC As Double
Dim varCancel As Variant, oCurrLayeR As AcadLayer
On Error GoTo Err_Control
Set oCurrLayeR = ThisDrawing.ActiveLayer
IsSetup
Start:
dblTOC = CDbl(InputBox("What is T.O.C. elevation? ie 12 or 0 or -12"))
ThisDrawing.SetVariable "ORTHOMODE", 1
intOSMode = ThisDrawing.GetVariable("OSMODE")
ThisDrawing.SetVariable "OSMODE", 32
inspt = ThisDrawing.Utility.GetPoint(, "Pick Insertion Point: ")
inspt(2) = inspt(2) + dblTOC
ThisDrawing.SetVariable "OSMODE", intOSMode
dblRotation = ThisDrawing.Utility.GetAngle(inspt, "Pick Front Side of PT: ")
Set objBlockRef = ThisDrawing.ModelSpace.InsertBlock(inspt, Path & "138kv-PT-ASSEMBLY.dwg", 1, 1, 1, dblRotation)
ThisDrawing.Regen acActiveViewport
Exit_Here:
ThisDrawing.ActiveLayer = oCurrLayeR
ThisDrawing.SetVariable "OSMODE", intOSMode
ThisDrawing.SetVariable "INSUNITS", 1
Exit Sub
Err_Control:
Select Case Err.Number
Case -2147352567
'Debug.Print Err.Number, Err.Description
varCancel = ThisDrawing.GetVariable("LASTPROMPT")
If InStr(1, varCancel, "*Cancel*") <> 0 Then
If GetAsyncKeyState(VK_ESCAPE) And 8000 > 0 Then
Err.Clear
Resume Exit_Here
ElseIf GetAsyncKeyState(VK_LBUTTON) > 0 Then
Err.Clear
Resume
End If
Else
If GetAsyncKeyState(VK_SPACE) Then
Resume Exit_Here
End If
'Missed the pick, send them back!
Err.Clear
Resume
End If
Case 13
GoTo Start
Case Else
MsgBox Err.Description
Resume Exit_Here
End Select
End Sub
As you can see, its a basic function, but I never planned on my users NOT entering a value.