.NET

Reply
New Member
MECODER
Posts: 2
Registered: ‎02-08-2014
Message 1 of 4 (220 Views)
Accepted Solution

Catch entities which intersected with a polyline

220 Views, 3 Replies
02-09-2014 02:46 AM

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.

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
Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 2 of 4 (204 Views)

Re: Catch entities which intersected with a polyline

02-09-2014 03:51 AM in reply to: MECODER
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
New Member
MECODER
Posts: 2
Registered: ‎02-08-2014
Message 3 of 4 (175 Views)

Re: Catch entities which intersected with a polyline

02-09-2014 09:33 PM in reply to: mzakiralam

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.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 4 of 4 (167 Views)

Re: Catch entities which intersected with a polyline

02-10-2014 01:22 AM in reply to: MECODER

 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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.