Comparing sublists separately to other lists items

Since English is not my native language and (I think) the problem that I’m trying to explain is pretty complicated, I hope you understand my explanation/the goal I want to reach:

I have a list of the ‘from rooms’ of some doors and a list of the rooms that I want to select.
I want the blue sublist to be compared only to the room on the first line, the red sublist needs to be compared only to the room on the second line and the green sublist only needs to be compared to the room on the third line.

Everything goes right untill I have 2 rooms next to each other with a common door.
This door should only have 1 from room, but since all three rooms are compared to all the rooms in the sublists, it gives a ‘true’ value when it needs to be false… (seed red cross)

I didn’t come up with the code block myself I got this from somewhere else and it probably needs to be adjusted in a small way but I just keep breaking my head on it and can’t come up with anything…
Or is there maybe a node that can replace this code block?

Any suggestions?

I think the best way is to not use the Code Block. Instead use the Element.Name node to get the names and next use an == (IsEqual?) node.

This is the same as you are doing now, but now you can use the “Levels” of the nodes. Place the top input on @L2 & the bottom input on @L1.

What this does is telling the == IsEqual node to apply the function differently. It says to the node "Use the First List in the top input (x) with the First Item in the Bottom input (y) etc…

I hope this explains it a bit. This is always a hard topic to explain :sweat_smile:

@Joelmick this doesn’t work…
The blue marked ‘true’ value needs to actually be false but is still being compared to another room in the list…
Also the names of the different rooms can be the same, multiple bathrooms, multiple bedrooms,…

AAAAH the problem is in the name “Badkamer”. Maybe it is better to Filter on something other then the Name of the Element?

You can also use the Element.Id Instead. This is Unique for each element. This will give the right list.

What is the goal in the end? What is the next step you want to do?

Yes, I figured it out.
It is indeed better to filter on something else so I changed the code block to work with the ID of the room and this works perfect now!

The end goal of this script is to create floors by room (multiple rooms at once over multiple levels) taking in account the ins and outs of windows and doors…
There is already a post on this forum about my major script so I’ll post the end result there (this was the last hurdle).

Aah nice that it works now! Good luck on further development.

1 Like