Windows from spaces

Hey all, I wrote a great script that collects all the windows within a room’s boundaries, then creates detail lines offset from those windows to create a “daylight occupancy zone”. It works great when I have a room selected.
However, on the MEP side of things, my company doesn’t work with rooms but with Spaces. Our template doesn’t even give us access to the architect’s rooms. I switched the graph to accept spaces (marked in blue), but the rest of the code still requires rooms to select the windows within them (marked in red).

Does anyone know of a package or node out there that allows you to do what Rooms.Windows does but with Spaces instead?
I’m getting more proficient with Python, so if this needs to be a custom node I’m willing to learn, but definitely need help getting there.

What do you mean by this? The rooms don’t have to be visible to be accessed. You get them directly from the architect’s linked document. That would be my first suggestion.

You could however, also try taking apart the custom node, saving out the python portion, and attempting to rewrite it for spaces. I’m thinking this might give you some trouble depending on how the windows are being “found”. Spaces won’t be linked to windows or doors like rooms are. You may have to translate from rooms to spaces somehow.

Rooms.Windows is really just a property of the window and a native part of Revit. Clockworks is just using the To Room and From Room built-in parameters.

image

There is no equivalent To Room/From Room for spaces. So you would have to use a different approach to find the associated windows. If your rooms and spaces are a 1:1 relationship, you could pull from the architectural model and translate that to your spaces. If not - then you’ll have to look at the geometry of the room and the geometry of the window. However, you should be able to pull the XYZ of the room calculation point from the window and see if that falls within the space. Note that this would require that all windows have the room calculation point enabled - and not all architects use this feature (although they should). Clockworks would also fail if windows are not using the window room calculation point.

1 Like

What I mean is that we link the arch’s Revit file into our MEP template, but when I do it doesn’t seem to transfer over the Rooms, meaning I can unpin the link, select it and tab forever but can’t locate/select a Room :confused: The interesting part is when I create automatic Spaces, it picks up where the rooms are, and if I use the Space Naming tool, it picks up on the Room information. :confused:

Sad to hear that the spaces and the windows will not link with each other. But I’ll take your advice and try to tear apart the custom node to see if I can get it to recognize the Spaces instead of the Rooms. Might be on later to ask for help translating some Python…

Well the rooms are definitely there, you just need to get them. You can check all the obvious culprits - make sure the room category is visible, make sure you’re checking the appropriate phase, make sure your view range cuts through the room geometry, etc. - but that doesn’t even matter since you’re using Dynamo. You don’t need to see the rooms to select them in Dynamo and get their values.

The Clockworks node isn’t going to lead you anywhere.
This will be a from scratch effort.

You can also use Space.CoreCenterBoundary (instead of Space.FinishBoundary), then you can search the linked windows by geometry intersection.

This is an interesting solution, thanks for the pointer!
When I use the code block you sent out, I get an error and it comes out null. I’m only selecting one space for this example but am I doing something wrong in the syntax that I can’t see? The error coming up says “Null value cannot be cast to Double”

The code block should be connected to the element list, not the boundaries.

1 Like

:man_facepalming: thanks