.NET

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

Catch entities which intersected with a polyline

226 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 (210 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 (181 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 (173 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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