Trouble comparing unequal rooms list

I’m having trouble with part of my script, i’m trying to compare selected rooms, with the “from room value on doors”.
I have no trouble if i have doors in all the rooms then it works like a charm.
But if i for instance do not have a door in the last rooms it messes up.

Here is a cut out of my graph

It works correctly for the green, blue and orange lines i have drawn for better explaning.

But then the purple is the cullprit, i want it to compare with the yellow also ash this is the correct.

I have tried using the “==” node with cross lacing where i cant get the trues out, but i have a very hard time getting the lists structure back to where it matches the “from room” so i can use it as a mask.

I’m kinda stuck here so any solutions around this would be much appeciated

1 Like

I worked with groub by Key… maybe you can recreate your script… :slight_smile:



1 Like

Hi Draxl
I tried you soultion but i don’t seem to be able to acvie want I want from it. But thanks anyways

Hi Henrik,

Maybe this is useful to you? Instead of relying on list order, look for values to pull out?

I’m using index for this, but sometimes a dictionary is a useful way of doing a similar job.

Hope that helps,


1 Like

Hey @Mark.Ackerley

Thanks for the advice I tried it out, but I dosen’t seem to get the results I want.

I can get out the rooms fine with your method. But as i need a boolean to filter the doors afterwards.

Purple right the other two that is false is set to true which is incorrect.

I added more af my graph so what i’m trying to achive is more visible


Can you show us the rest of the graph? A door with no FromRoom value should still return a null, not just disappear. In the last image you posted you specifically remove those doors, which is obviously going to mean that your list lengths are off.

Hey Nick.
I have added the whole graph here.
FloorByRoomthreshold_test.dyn (334.6 KB)

And the test file i have used
Floors test.rvt (3.3 MB)

The problems occur when i i remove the door between room D and E, thus leaving room D with no doors. So i’m aware it my list management that is off, but cant seem to find out how to fix it

Instead of filtering out your nulls at the start, is a solution to carry them through, then replace them with false at the end after you’ve checked if the doors match a room?

Hey Hamish
Thanks for you input, i tried it out.
But the problem does not orginated from filtering the nulls unfurtunetaly.
Its comes after this part,

Where else earlier in the script have you filtered down the list of doors? Should be somewhere that needs either a null or empty list in order to keep the list lengths identical.

Edit: Loaded your file. It crashed my Revit, good thing the problem might be early on so I can just freeze off everything. Check this filtering here, if you adjust it a little you can have it produce an empty list when rooms have no doors so the list of rooms and doors both have 6 indices at that level instead of an unequal 5 for one 6 for the other as it originally did.

Hey Hamish
Sorry i never got back to your answer.

You were right about the filtering way was wrong.
I ended up just removing the GetSorrundingElements and use the Room.Doors instead.

But you pointed me in the right direction thank you!