find ALL intersectionpoints between line and polyline

find ALL intersectionpoints between line and polyline

stefanveurink68AXD
Advocate Advocate
466 Views
1 Reply
Message 1 of 2

find ALL intersectionpoints between line and polyline

stefanveurink68AXD
Advocate
Advocate

I'm working on some code to place dimensions, so let user pick 2 points and code will place dimensions between all intersections of objects with the line between this 2 points. 

 

Points are collected by: 

Point3dCollection punten = new Point3dCollection();

foreach (ObjectId id in set.GetObjectIds())
{
 Entity ent = tra.GetObject(id, OpenMode.ForRead) as Entity;
 maatlijn.IntersectWith(ent, Intersect.OnBothOperands, punten, IntPtr.Zero, 
 IntPtr.Zero);
}

 

this works fine as long as objects are 'lines'. 

 

However, when intersecting object is polyline, it doesn't seem to give all points, sometimes even results into fatal error. 

 

Any idea on how to fix this?

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

stefanveurink68AXD
Advocate
Advocate
Accepted solution

I'm sorry, seems like i've got a bad day today. 

 

Problem was in the selectionset-filters. not in the intersectwith.

 

had to add lwpolyline & 3dpolyline to it.  

 

Consider this topic closed. 

0 Likes