Message 1 of 6
vlax iteration error

Not applicable
08-29-2006
01:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello all, if you havent read my previous post im using vlax to find perpendicular points. The function i was helped to write is as such
Public Function fncPerpendicularTo(oEnt As AcadEntity, dPoint As Variant) As Variant
Dim perpPoint As Variant
Dim obj As Curve
Set obj = New Curve
Set obj.Entity = oEnt
perpPoint = obj.GetClosestPointTo(dPoint, True) ---error here
fncPerpendicularTo = perpPoint
End Function
The function works very well but when i call it from an iteration which loops more than about 30 or 40 times it will error out with a Runtime error '2000' where i marked in the code. If i keep the amount of iterations very small it works fine. Any idea what is going on and how i can solve this problem?
Public Function fncPerpendicularTo(oEnt As AcadEntity, dPoint As Variant) As Variant
Dim perpPoint As Variant
Dim obj As Curve
Set obj = New Curve
Set obj.Entity = oEnt
perpPoint = obj.GetClosestPointTo(dPoint, True) ---error here
fncPerpendicularTo = perpPoint
End Function
The function works very well but when i call it from an iteration which loops more than about 30 or 40 times it will error out with a Runtime error '2000' where i marked in the code. If i keep the amount of iterations very small it works fine. Any idea what is going on and how i can solve this problem?