vlax iteration error

vlax iteration error

Anonymous
Not applicable
494 Views
5 Replies
Message 1 of 6

vlax iteration error

Anonymous
Not applicable
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?
0 Likes
495 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
I haven't much time for testing today, sryabinin, but I may be able to look
at it tonight. I've heard, but not experienced it myself, that there is some
sort of memory problem with the VLAX code. This may be the cause.

Jeff

wrote in message news:5311489@discussion.autodesk.com...
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?
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks a lot, i appreciate it.
0 Likes
Message 4 of 6

Anonymous
Not applicable
The author of that crap was fully aware of the fact
that there were problems with the VL ActiveX interface,
as have been discussed here many times, but chose to
downplay if not conceal that, for whatever reason.

You're just one of the victims.

One of the problems with AutoCAD and Autodesk, is
that every single one of its high-level end-user APIs
is grossly incomplete, forcing customers to resort to
unreasonable hacks like this one.

There are some who believe that this was deliberate
because of the idea that while Autodesk likes to make
marketing points with the idea that you can program
its software, allowing customers to solve problems that
way is not in their financial interests, because it makes
it harder for them to sell the solution in the form of a
feature in a future release of the product.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5311489@discussion.autodesk.com...
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?
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thats rather sad but I cant say unexpected. Does this mean though that there is basically no solution to the problem I am having?
0 Likes
Message 6 of 6

Anonymous
Not applicable
I don't believe so because the problem is in the
ActiveX layer of Visual LISP.

At this point, assuming you are using AutoCAD
2006 or later, I would consider moving to VB.NET.

It offers solutions to this and most of the other
'common' problems encountered when using VBA,
at the expense of a learning curve.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5312572@discussion.autodesk.com...
Thats rather sad but I cant say unexpected. Does this mean though that there is basically no solution to the problem I am having?
0 Likes