TheSwamp
Code Red => VB(A) => Topic started by: rude dog on April 09, 2008, 05:03:45 PM
-
How do get this piece of to exit smoothly without bombing out if the user selects a point out in space or right clicks?
Public Sub GetEntExample()
Dim returnObj As AcadObject
Dim basePnt As Variant
On Error Resume Next
' The following example waits for a selection from the user
RETRY:
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
If Err <> 0 Then
Err.Clear
MsgBox "Program ended.", , "GetEntity Example"
Exit Sub
Else
returnObj.Update
MsgBox "The object type is: " & returnObj.EntityName, , "GetEntity Example"
returnObj.Update
End If
GoTo RETRY
End Sub
-
what exactly are you referring to? It did exactly what I expected it to
-
I guess what I mean is do you want to avoid the Program ended msgbox or do you want it to say "You missed picking something, try again" or what ?
-
Start with a better getentity http://www.theswamp.org/index.php?topic=9301.msg119833#msg119833 (http://www.theswamp.org/index.php?topic=9301.msg119833#msg119833)
-
At Lunch time today it wasnt working properly I had about 4 or 5 different versions up :oops:
This one does work though
Thanks for the other thread as well looks very useful.
-
Found out what the problem was @ work
In the Tools --> Options box in the VBA IDE I had the box checked that said "Break on all Errors"
when it should have been set up to break on Unhandled errors.
Thanks