# How to calculate % Windows Facade exterior wall for each Unit

Hi everyone,
I want to know if someone can help me please to create a script to calculate the pourcentage of windows and wall exterior area for each Unit
I have a project of 250 residential units and i need to calculate for each unit % Windows vs Wall
Thanks !

Hello and welcome to the forum!

First up, this isnât a great âfirst graphâ to tackle as itâs got a complex data structure and will require a good amount of grouping, sorting, and filtering. Hopefully youâre ready to take on a challenge or are ânew to the forum but not new to computational designâ. Either way the community will be able to help periodically if you post your attempts and enough insight for us to see where youâre going. Iâm going to assume you can easily collect the rooms which youâre after as a starting point, soâŚ

From your list of the rooms to analyze, try working along these steps:

1. Use the Room.Boundaries node (Clockwork package) to get the bounding elements of each room.
2. Get the category for each bounding element
3. Filter out bounding elements which are not walls using a comparison to the associated category.
4. Get the type of the included walls from the resulting category filter.
5. Get the use parameter from the list of wall types.
6. Filter out walls which are not exterior use from the filtered bounding elements (step 3âs âinâ output) using a comparison to the use parameters.
7. Get the Element ID of the exterior wall elements which remain in the list.
8. Get the Element ID of the bounding elements (step 1)
9. Get the index of the exterior IDs in the bounding elements list
10. Get the boundary lines of the room using a List.GetItemAtIndex node.
11. If your walls are plumb and a consistent height in each room, multiply the roomâs height by the length of each exterior boundary line (step 10); if not get the room geometry, explode it to base surfaces, filter out the floor and ceiling surfaces using the Z component of their normal, filter the remaining wall surfaces by including only surfaces which intersect with the boundary lines, and finally get the area of each and sum the values. This is your exterior wall area for each room.
12. Create a dictionary of areas by the associated room IDs.
13. Get all the windows in the project.
14. Get the room which each window is in using a Window.Rooms node (Clockwork package).
15. Get the Element ID of the windowâs rooms
16. Get the area of each window using whatever parameter fits your project.
17. Group the window area by their associated room ID.
18. Sum the sublists of window areas into a single value. This is the area of windows in each room.
19. Use the âunique keysâ from the group by key node (step 17) to find the room associated with each window area.
20. Use the unique keys to pull the relevant exterior wall area from the dictionary or exterior wall areas by room (12)
21. If you went with the multiplication of curve length and height in step 11 divide the window areas (step 19) by the exterior wall areas (step 11) to get the % of the exterior envelope which is a window. If you went the geometry route, divide the window area by the sum of the window area and the exterior wall area to get the desired value.
22. To do the analysis by âunitâ instead of room, get the IDs from the unique keys (this list is still ordered), and use a Element.ByID node (Clockwork) to get the rooms, get which unit each room is in, group the window areas (step 18) and room areas (11) by these values, sum them, and repeat a version of step 21 to get the percentage of exterior envelope which is a window in each unit. Alternatively you could just select your rooms by unit early on instead of trying to process all rooms, sum the window and exterior wall values before performing the analysis in step 21 and use the result as the % for that unit. Note that this means youâll need to run the graph 250 times though, so there is a degree of scale which is desirable the other way. Also alternatively you could assign the values of the window and exterior envelope to values int eh room, and then use a room schedule to update the calculations.
2 Likes