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?
On the intersection point pl2 doesnt have any vertex.
Thanks.
Solved! Go to Solution.
Solved by R.Gerritsen4967. Go to Solution.
@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.
@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.
@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. ..
Cool, i hope autodesk solve the problem one day,
thanks for sharing.