Get all doors within each area

Hi, I am trying to find a way to get all doors within each area in the model so I can assign the apartment reference to the door mark, and eventually automatically add a number sequence to the doors in the apartment. I’m a Dynamo novice and I keep falling at the first hurdle of mapping the doors to each area. I’ve created a simple model to test the scripts which has 3 areas, each with 3 doors inside or at the edge of the area boundary.

I’ve tried several methods from searching these forums to achieve this but they all only report 2 doors out of the 9 in the model. Could someone point me in the right direction please and tell me what I’m doing wrong? Below is the script I’ve been working on. Thanks in advance!

Can you use the picture button in the top right of Dynamo to create your screenshot.
image
Currently we can’t see your node names!

Also if you could expand the drop downs for each node so we can see whats going on we’ll have a better idea of how to help!

OK, thanks haganjake2


I’m uploading again as the node names didn’t show the last time

I’ve also tried something a bit simpler to make the areas solid, but the results are the same. It only says 2 out of the 9 doors intersect with the areas

I recommend running this per area view instead of across the entire model, running it 1x1 with a filter to highlight doors by the area indicator to ensure you don’t have any issues from an unforeseen geometry issue, while also reducing the number of geometry checks you have to run by the number of areas per floor multiplied by one less than the number of floors in your model. Alternatively you could group both the areas and the doors by their level, and sort the sublists so that your sublists have matching level keys, but always double check the results on each view when using geometry like this.

  1. Get all areas in the view
  2. Get all doors in the view
  3. Get the solid of each area
  4. Get the location of each door - using points will be a bit faster than the solids of the doors as you’d have to either unction the nested solids into one or do multiple distance checks.
  5. Get the distance from each door to each area - note for each door you should a sublist with as many items as you have areas
  6. Sort the areas by the distances with a sort by key node - use longest lacing and @LL2 for both inputs
  7. Get the first area and first distance from each of the outputs from the sort by key node
  8. Check if the distance is greater than a desired precision - ie: 1’-0”.
  9. Use a List.FIlterByBoolMask to remove the areas which didn’t pass the distance test.
  10. Flatten the areas list, and pull the parameter(s) you want to use as an identifier for the doors (ie: Name, number, etc) and build the string or number.
  11. Set the parameter you desire for the original doors (waaaaaay back in step 1) to the string or number pulled from the areas list.

As an alternative, if you do a similar exercise with rooms you can pull the doors to room and/or from room values, pull the area associated with the room, and set the door’s value from that.

Thanks for the advice Jacob. Makes sense to do it one view / level at a time. And thanks for the tip using points to locate the doors. I think I understand the general approach so I’ll have another stab at it!

1 Like