Message 1 of 18
Stumped again

Not applicable
01-22-2003
06:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I'm writing this routine to draw a structural grid still, and I've got
everything working honky-dory so far (thanks to all of you) except for the
fact that it never gets to the second Do...Until loop below. I get the
dimensions from the lettered grids fine and it fills the array perfectly
but when I hit enter and the blnCheck variable clears the test it just
quits. It never even gets to setting "intGrid1 = 1", I've tried making
intGrid1 a double and I've tried making intIndex an independent variable in
each loop. I've posted the entire routine as it is right now because I
have no clue where the error might be (I don't get any messages). Of
course any and all help is greatly appreciated, I hope this isn't too much
code to post:
Option Explicit
Public Sub DrawGridSystem()
Dim varXDims() As Variant
Dim varYDims() As Variant
Dim dblOrigin(2) As Double
Dim dblDwgScale As Double
Dim dblCurDist As Double
Dim strDirection As String
Dim strLocation As String
Dim strGridA As String
Dim intGrid1 As Integer
Dim intIndex As Integer
Dim blnCheck As Boolean
With ThisDrawing.Utility
.InitializeUserInput 1, "Vert Horiz"
strDirection = .GetKeyword(vbCr & "Letters should be [Vert/Horiz]:
")
Select Case UCase(strDirection)
Case "VERT"
.InitializeUserInput 1, "Top Bottom"
strLocation = .GetKeyword(vbCr & "A is at the [Top/Bottom]:
")
Case "HORIZ"
.InitializeUserInput 1, "Left Right"
strLocation = .GetKeyword(vbCr & "A is at the [Left/Right]:
")
Case Else
MsgBox "Invalid Input"
End Select
strGridA = "A"
intIndex = 0
Do
dblCurDist = .GetDistance(, "Enter the distance from grid " &
strGridA & " to grid " _
& Chr(Asc(strGridA) + 1) & " [Enter to end]: ")
ReDim Preserve varXDims(intIndex)
varXDims(intIndex) = .DistanceToReal(dblCurDist,
acArchitectural)
strGridA = Chr(Asc(strGridA) + 1)
blnCheck = IsEmpty(varXDims(intIndex))
intIndex = intIndex + 1
Loop Until blnCheck = True
intGrid1 = 1
intIndex = 0
Do
dblCurDist = .GetDistance(, "Enter the distance from grid " &
intGrid1 & " to grid " _
& intGrid1 + 1 & " [Enter to end]: ")
ReDim Preserve varYDims(intIndex)
varYDims(intIndex) = .DistanceToReal(dblCurDist,
acArchitectural)
intGrid1 = intGrid1 + 1
blnCheck = IsEmpty(varYDims(intIndex))
intIndex = intIndex + 1
Loop Until blnCheck = True
End With
End Sub
--
matthew g.
everything working honky-dory so far (thanks to all of you) except for the
fact that it never gets to the second Do...Until loop below. I get the
dimensions from the lettered grids fine and it fills the array perfectly
but when I hit enter and the blnCheck variable clears the test it just
quits. It never even gets to setting "intGrid1 = 1", I've tried making
intGrid1 a double and I've tried making intIndex an independent variable in
each loop. I've posted the entire routine as it is right now because I
have no clue where the error might be (I don't get any messages). Of
course any and all help is greatly appreciated, I hope this isn't too much
code to post:
Option Explicit
Public Sub DrawGridSystem()
Dim varXDims() As Variant
Dim varYDims() As Variant
Dim dblOrigin(2) As Double
Dim dblDwgScale As Double
Dim dblCurDist As Double
Dim strDirection As String
Dim strLocation As String
Dim strGridA As String
Dim intGrid1 As Integer
Dim intIndex As Integer
Dim blnCheck As Boolean
With ThisDrawing.Utility
.InitializeUserInput 1, "Vert Horiz"
strDirection = .GetKeyword(vbCr & "Letters should be [Vert/Horiz]:
")
Select Case UCase(strDirection)
Case "VERT"
.InitializeUserInput 1, "Top Bottom"
strLocation = .GetKeyword(vbCr & "A is at the [Top/Bottom]:
")
Case "HORIZ"
.InitializeUserInput 1, "Left Right"
strLocation = .GetKeyword(vbCr & "A is at the [Left/Right]:
")
Case Else
MsgBox "Invalid Input"
End Select
strGridA = "A"
intIndex = 0
Do
dblCurDist = .GetDistance(, "Enter the distance from grid " &
strGridA & " to grid " _
& Chr(Asc(strGridA) + 1) & " [Enter to end]: ")
ReDim Preserve varXDims(intIndex)
varXDims(intIndex) = .DistanceToReal(dblCurDist,
acArchitectural)
strGridA = Chr(Asc(strGridA) + 1)
blnCheck = IsEmpty(varXDims(intIndex))
intIndex = intIndex + 1
Loop Until blnCheck = True
intGrid1 = 1
intIndex = 0
Do
dblCurDist = .GetDistance(, "Enter the distance from grid " &
intGrid1 & " to grid " _
& intGrid1 + 1 & " [Enter to end]: ")
ReDim Preserve varYDims(intIndex)
varYDims(intIndex) = .DistanceToReal(dblCurDist,
acArchitectural)
intGrid1 = intGrid1 + 1
blnCheck = IsEmpty(varYDims(intIndex))
intIndex = intIndex + 1
Loop Until blnCheck = True
End With
End Sub
--
matthew g.