Catch entities which intersected with a polyline

Catch entities which intersected with a polyline

Anonymous
Not applicable
809 Views
3 Replies
Message 1 of 4

Catch entities which intersected with a polyline

Anonymous
Not applicable

Hi All,

I have good experince with VB.Net, But i am new in prgramming for Autocad .

I had wrote code that catch all polylines on drawing, but now i have a  problem, i need to catch that entities (blocks in my case) which intersected  with each polyline.

any help please.

Thank you in advance.

0 Likes
Accepted solutions (1)
810 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution
Hi , to get intersection point between to entities you have to use 'entity.IntesectWith' function. With this function, you can get intersecting point. if for an entity if you get intersection point , you can add that entity in your list or array. you can have a look on below link where you can find how intersection point can be found between 2 entities.

http://forums.autodesk.com/t5/NET/Find-intersection-point-of-two-lines/m-p/4769671#M38812
0 Likes
Message 3 of 4

Anonymous
Not applicable

Thank you very much Mr. mzakiralam
This is good try.
I know how to get intersection points using (IntersectWith) function, My problem is how to specify the type of the entity that intersects with the polyline.

0 Likes
Message 4 of 4

Anonymous
Not applicable

 entity.GetType() will help you to get entity type. you can also use below function.

 

Dim ent as entity = transaction.GetObject(ObjectId, OpenMode.Write)

 

If TypeOf ent is Polyline

 

'do as you want

 

End If

0 Likes