TheSwamp

Code Red => VB(A) => Topic started by: David Hall on June 11, 2007, 04:35:54 PM

Title: continue picking points
Post by: David Hall on June 11, 2007, 04:35:54 PM
Im looking for a very simple example of using while or Do While to pick points til user hits enter to stop.  I tried using
Code: [Select]
While Not Pt2 = Nulland every variation I could think of, but couldn't get it.  Im sure its simple, I just cant get it.

thanks
Title: Re: continue picking points
Post by: Fatty on June 11, 2007, 05:27:43 PM
I've used this one

~'J'~

Code: [Select]
'' written by Tony Tanzillo
'' request check "Break on Unhandled Errors" in  General options
Public Sub LoopExample()
Dim Msg As String
Msg = vbCrLf & "First point: "
Dim MyPoint As Variant
Do
On Error Resume Next
MyPoint = ThisDrawing.Utility.GetPoint(, Msg)
If Err Then
Err.Clear
Exit Do
End If
On Error GoTo 0

' Process the entered point here
ThisDrawing.ModelSpace.AddCircle MyPoint, 10#
Msg = vbCrLf & "Next point or ENTER to exit: "
Loop
On Error GoTo 0

End Sub
Title: Re: continue picking points
Post by: David Hall on June 11, 2007, 05:42:28 PM
Thats what I was looking for.  thanks
Title: Re: continue picking points
Post by: Fatty on June 13, 2007, 09:48:07 AM
Thanks to Tony :)

~'J'~