How to fetch the windows based on the facades in which they are in?
Can you be more specific?
The direction they face (FamilyInstance.FacingOrientation)?
The wall they are hosted in (Element.Inserts or FamilyInstance.GetHost)?
Basically, I want to find the distance between the mid point of the window and the normal facade next to it .
Here you can also find the picture!!
We are using the approach of bounding box and ray tracing but don’t know if that’s the right approach.
I would t go that way. Anytime ray tracing is involved I find you can usually do things faster by stepping back to the white board.
Assuming: all walls are straight as per your pic, and that geometry complexity is similar (ie: no walls that have variable length in plan) as per your pic…
- Get all windows
- Get their host
- Get the window locations
- Get the host’s locations
- Use a ‘Geometry.PointClosestTo’ node to find the point on the host location line closest to the window (directly below said window in the line)
- Split the curve at the point
- Find the length of your curves - this is how far each window is from the adjacent corners.