how to find the intersection points of polyline crossing a rectangle using c#

how to find the intersection points of polyline crossing a rectangle using c#

VallimanalanT
Enthusiast Enthusiast
1,938 Views
3 Replies
Message 1 of 4

how to find the intersection points of polyline crossing a rectangle using c#

VallimanalanT
Enthusiast
Enthusiast

Hi,

 

please advise, how to find the intersection points of polyline crossing a rectangles (layer name based filtering) using c#

image.JPG

Thanks

Accepted solutions (1)
1,939 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant

Hi,

 

Assumming Rectangle1, Rectangle2 and Rectangle3 are also polylines, you can simply use the Entity.IntersectWith() method.

If they're not polylines, you have to provide more details.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 4

VallimanalanT
Enthusiast
Enthusiast

Hi,

 

yes all rectangles are polyline. But number of rectangles are unknown. we need to identify the number of intersection points based on cable polyline

 

Thanks,

vallimanalan.T

Message 4 of 4

_gile
Consultant
Consultant
Accepted solution

You have to select the rectangles using some selection filter.

Call cablePolyline.IntersectWith() for each selected rectangle using the same Point3dCollection

The Point3dCollection would contain all intersection points.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub