Select Walls that Do Not host Doors

Ive created a simple graph that can select all walls or walls hosting doors but I cant make it work in the opposite way - select all walls NOT hosting doors.

Any ideas what I may have done wrong?

When run it selects a random set of walls, indicating a mistake somewhere.

Two things here, the first is to help things run faster, and the second is a likely answer to your question.

  1. Right now you have a wall for every door, but a wall hosting two doors would be contained twice so you’ve got n+ walls when all you want is n. Add a List.UniqueItems after the FamilyInstance.GetHost to reduce the number of walls to just what you want.

  2. After you have all the walls, and all the walls which host doors, you can use a List.SetDifference to pull out items that are in the “all walls” list but are not in the ‘door walls’ list. If you’re not sure how to use the the node place it on canvas and try the extended node help (right click the node and select help) - there should be a sample graph you can insert into the canvas.

2 Likes

Thank you so much Jacob, so obvious and simple! It works like a charm. Many thanks.

1 Like