There is something wrong in the intersectwith function, how to deal with this?

There is something wrong in the intersectwith function, how to deal with this?

stefanveurink68AXD
Advocate Advocate
358 Views
1 Reply
Message 1 of 2

There is something wrong in the intersectwith function, how to deal with this?

stefanveurink68AXD
Advocate
Advocate

Almost can't imagine it but, but don't see any other expanation:

 

Explain this: 

 

            Point3dCollection snijpunten = new Point3dCollection();
            bovenaanzicht.IntersectWith(hulplijn1, Intersect.OnBothOperands, snijpunten, IntPtr.Zero, IntPtr.Zero);
            
            int aantalsnijpunten = snijpunten.Count;

            if (aantalsnijpunten > 0)
            {
                foreach (Point3d snijpunt in snijpunten)
                {
                    double debug = bovenaanzicht.GetDistAtPoint(snijpunt);

I get a 'eInvalidInput' at defining the 'debug double'. 

 

I'm calculating pretty much intersections in my code and suddenly this happens, every time at same moment. 

Was having a similar issue a few days ago, couldn't figure it out, so rewrote the whole code in some other way, now this same thing happens again...

 

Is there a way to solve this?

 

0 Likes
Accepted solutions (1)
359 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant
Accepted solution

Hi,

This is perhaps an accuracy issue (this may happen if entities are far away from Origin).

You can try this:

Point3d pointOnCurve = bovenaanzicht.GetClosestpointTo(snijpunt);
double delta = snijpunt.GetDistanceTo(pointOnCurve);
double debug = bovenaanzicht.GetDistAtPoint(pointOnCurve);

 

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub