.NET

Reply
Active Contributor
ditran
Posts: 27
Registered: ‎01-28-2013
Message 1 of 4 (375 Views)
Accepted Solution

Line intersect with block

375 Views, 3 Replies
03-20-2013 01:38 AM

Hi All,

I find the intersected point of Line and block as this code:

'bref is a block reference
Dim tmpLine As New Line(pt1, bref.Position)
Dim ptCol As New Point3dCollection
bref.IntersectWith(tmpLine, Intersect.OnBothOperands, ptCol, 0, 0) 
Dim acLine As New Line(pt1,ptCol(0))

 But the intersected point is not located on block as picture below. I don't know what happen.

Thank you for any help.

Easiest way is explode BlockRerence (method BlockReference.Explode but without adding entities to Database) and then intersect your's line with every entity in collection of exploded entities (maybe recursive if entity in collection is also BlockReference).

Moderator
Alexander.Rivilis
Posts: 1,446
Registered: ‎04-09-2008
Message 2 of 4 (357 Views)

Re: Line intersect with block

03-20-2013 06:27 AM in reply to: ditran

It is look like you found intersect point which on bounding box of block reference:

Intersecting any entity with a BlockReference and retrieving the intersection points


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Active Contributor
ditran
Posts: 27
Registered: ‎01-28-2013
Message 3 of 4 (353 Views)

Re: Line intersect with block

03-20-2013 06:48 AM in reply to: ditran

I found the intersecting point of line and bounding box of block reference. Can you help me with VB.net code.

 

Thanks,

Moderator
Alexander.Rivilis
Posts: 1,446
Registered: ‎04-09-2008
Message 4 of 4 (348 Views)

Re: Line intersect with block

03-20-2013 07:01 AM in reply to: ditran

Easiest way is explode BlockRerence (method BlockReference.Explode but without adding entities to Database) and then intersect your's line with every entity in collection of exploded entities (maybe recursive if entity in collection is also BlockReference).


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!