Floor Area / Window Area

Hello Forum
I thought i made a “plug and play” Floor window Area.
I had the Script working in a fresh Model with small amount of room and window and it worked perfektly.

Window and door til upload.xlsx (9.0 KB)
Revit test model.rvt (3.1 MB)

But when i ran the script in a used model it didnt really work as intented
Window and door broken.xlsx (12.2 KB)

I would like to get some inputs on how minimize the potential on Error and corrupted data.

Or how to take a step back and take another angle on the script.

What i attended to do with the script was to:

Get the amount of window in a room with the Window.Room node like
Room 1 *1 window
Room 2 0 window
Room 3 4 windows
Room 4 1 Window

Then get all the height parameters from the window and match them like

1 Height in list 0

0 height in list 1

3 height in list 4
and after that merge the 2 list together

I fixed the Script
Glasandel iforhold til gulv Please.dyn (72.8 KB)

I think it works very well now:)

If you find any improvement please reply

I have one issuse with the Script tbh
when i use the script on my laptop witch also runs Dynamo 2.0.1
It reads 0 as Null witch breaks the Mats.SUm and Math round nodes any suggestions