basepointdesignz
Programmer
Hi,
Does anybody know how I can break a Do (while/until)...Loop when the user presses 'Enter'?..
This will be for getting multiple points from AutoCAD and the question is an extension on my previous thread about getting multiple points but I didn't want the question lost and avoided..
If got a do...loop that can get the points but I can't break out of the loop.. Here's snippet of the code....
Any ideas,
Cheers,
Renegade.. BULLET-PROOF DESiGNZ
renegade@tiscali.co.uk
+447919 117062 (mobile)
Does anybody know how I can break a Do (while/until)...Loop when the user presses 'Enter'?..
This will be for getting multiple points from AutoCAD and the question is an extension on my previous thread about getting multiple points but I didn't want the question lost and avoided..
If got a do...loop that can get the points but I can't break out of the loop.. Here's snippet of the code....
Code:
Private Sub CommandButton7_Click()
Dim ptx() As Double 'Point array (multiple if necessary)..
Dim polyXX As AcadPolyline ' Polyline to be drawn from the points array..
Dim countx As Integer 'Counter for loop..
Dim KeyAscii As Integer 'Key press (Enter)..
areaform.hide
' Start the point pick loop..
Do While KeyAscii <> 13
' Error Test for GetPoint method..
On Error Resume Next
TryAgain:
ptx() = ThisDrawing.Utility.GetPoint(, "Pick a point. (Press 'Enter' to finish)..")
ErrHndlr:
If Err.Number <> 0 Then
Err.Clear
GoTo TryAgain
End If
On Error GoTo ErrHndlr
countx = countx + 1 'Add 1 to the counter..
Loop 'end loop..
ReDim Preserve ptx(0 To countx - 1) 'Re-dimension the ptx() variable..
Set polyXX = ThisDrawing.ModelSpace.AddPolyline(ptx) 'Draw a polyline from the points array..
End Sub
Any ideas,
Cheers,
Renegade.. BULLET-PROOF DESiGNZ
renegade@tiscali.co.uk
+447919 117062 (mobile)