Intersection face with line in front of door

Intersection face with line in front of door

Anonymous
Not applicable
656 Views
4 Replies
Message 1 of 5

Intersection face with line in front of door

Anonymous
Not applicable

I'm trying to find the intersection of the line with the face. But sometimes the line gets in the door and therefore there is no crossing. I find the coordinates of the starting point:

 

BoundingBoxUV bboxUV = face1.GetBoundingBox();

UV center = (bboxUV.Max + bboxUV.Min) / 2.0;

location = faceinlist.Evaluate(center);

XYZ pt2 = location + 0.82 * normal;

Line line = Line.CreateBound(location, pt2);

 

 SetComparisonResult intersectionPoint = face2.Intersect(line);
                                        if (intersectionPoint != SetComparisonResult.Disjoint)
                                        {

How to provide for such cases when the doors are in the middle? I guess that it is necessary to find several points in different places, but I did not succeed

0 Likes
657 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Dear Vadim,

 

Your question leaves a lot of room for guesswork.

 

When you say 'face' I assume you mean the face of a wall.

 

When you say 'door in the middle', I assume that you mean the door is in the middle of the wall, and a ray that you shoot to try to hit the wall goes through the door opening, so that no intersection is found.

 

If those assumptions are correct, I see (at least) two choices:

 

  • Temporarily remove all the openings from the wall in a transaction that is rolled back afterwards before shooting the ray; The Temporary Transaction Trick: http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.53
  • Use the wall location curve and intersect the ray with an imaginary vertical face standing on that instead of using the real wall faces.

 

I hope this helps.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 5

Anonymous
Not applicable

Yes, I'm trying to find the intersections of the vector from the side of the room with the edge of the wall.
How i can  use the wall location curve and intersect the ray with an imaginary vertical face?

since I will need to study a wall that has intersections with a vector from the side of the room with the edge of the wall for the presence of doors in it.

0 Likes
Message 4 of 5

Anonymous
Not applicable

I tried to remove the doors from the wall, but did not get the intersection

0 Likes
Message 5 of 5

Anonymous
Not applicable

I tried to use a nested transaction, but got an error
An unhandled exception of type 'System.AccessViolationException' occurred in RevitDBAPI.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

0 Likes