.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IntersectWith command problem

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
ekoneo
275 Views, 5 Replies

IntersectWith command problem

When I use IntersectWith command I am having problem. 

Code is:

 

Point3dCollection ptColl = new Point3dCollection();
line.IntersectWith(pl2, Intersect.ExtendThis, ptColl, thisGraphicSystemMarker2, otherGraphicSystemMarker2);
ed.WriteMessage("\n" + ptColl.Count);

 

However ptColl.Count gives 2 although there is only one intersection possiblity. What is the reason?

SamplePhoto.png

 

On the intersection point pl2 doesnt have any vertex.

 

Thanks.

 

5 REPLIES 5
Message 2 of 6
R.Gerritsen4967
in reply to: ekoneo

Maybe this is of some help...

 

To help troubleshooting, it might be helpful to write the coordinates of the points to the commandline. This way you can find out if they are the same.

Message 3 of 6
ekoneo
in reply to: R.Gerritsen4967

@R.Gerritsen4967 Really, exactly the problem is this. Thank you for your reply. I found the reason in the page:

"The code given above, when compiled, computes the intersection points and stores them in intPoints Points3DCollection. It is evident from the given geometry of both polylines that there should be a single point of intersection. On the contrary, the output returns two intersection points as shown below."

from: https://imrananees.blogspot.com/2021/02/analyzing-bug-in-intersectwith-autocad.html

 

Thank you.

Message 4 of 6
essam-salah
in reply to: ekoneo

hi@ekoneo

so how did you recognize the fake intersection point from the true one ?

Message 5 of 6
ekoneo
in reply to: essam-salah

@essam-salah hi.

It is a bit long solution but I get the right point. Only one of them is on the pl2. I prepare small for cycle including try catch end GetDistAtPoint function.  GetDistAtPoint gives an "Autodesk.AutoCAD.Runtime.Exception" error. Via the error existance I can get the true point. When catch side working I deleted the point from the point collection. Sory for my bad English. I wish I could tell what I did.

Message 6 of 6
essam-salah
in reply to: ekoneo


@ekoneo wrote:

@essam-salah hi.

It is a bit long solution but I get the right point. Only one of them is on the pl2. ..


@ekoneo 

Cool, i hope autodesk solve the problem one day,

thanks for sharing.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost