Selecting doors and windows from room X to room Y

Revised Revit (made a few edge case conditions and removed unnecessary geometry/elements so it’d post to the forum):
FloorByRoomAndThresholds-ComplexifiedGeometry.rvt (3.8 MB)

Revised dyn:
FloorByRoomAndThresholds - AnotherMethod.dyn (101.3 KB)

Might be able to simplify that a bit more if you spend some time on it, perhaps using some in-line design script in place of some of the longer strings of nodes. Key aspect was remembering that you’re working with rooms at first - so collecting ALL the doors on a level adds some additional time since you were just filtering most of them out - you wouldn’t go get every spice out of the spice rack if you knew you only needed salt and pepper. Also by querying parameters and properties of the doors it reduces geometry calculations. Some examples:

  • No need to build a vector by the wall’s start and end point as the door already has a FacingOrientation.
  • No need to build an offset point from the door’s location and see if it’s inside the room, as the door already knows which room it’s moving from.

Another thing that helps is reducing the number of long, untraceable wires in the graph. I know it takes time but you had a few duplicate efforts which I don’t think you would have come up against if things were a bit cleaner.

I did delete your UI as it was adding a degree of complexity I didn’t want to get into at the moment. You can open the old graph, copy the nodes, and then open this graph to reinsert it quite quickly.

2 Likes