I’m trying to use Dynamo to measure the general location of an element to a room. We need to make sure the element is within range of a room. I have it set to override the color of the element if it’s out of range, or keep it the same if it is.
Right now, I have an easy way of selecting 1 room and several elements, but that would be slow and inefficient when we have a high rise or large building with multiple rooms. We want to be able to run a dynamo script to compare elements assigned to rooms without them being in the room.
So far, I’m trying to use a parameter to set my room assignment value and us creating a room within the room we’re going to use as our base point. I don’t want to have to run the script every time I want compare 1 room to the elements assigned to it. I want to be able to lay the ground work for the script and just hit Run. Is there a way of looping the script to run Elements with Parameter Value of X against Room X, then run Elements with Y to Room Y, etc?
@nschmittIPDG Welcome to the forum
since there is no graph i would like to ask you if you use the Elements in Room node (Archilab package)
It sounds like you have objects outside of the room geometry that you want to correlate to the room (I assume you aren’t able to work with room calculation points?).
- What defines the measurement? Centroid of the room? Room location point?
- Are you associating the elements to the room in a separate workflow?
To generically answer your question, you can group the elements in a list structure that matches your room list, get the point data of both, then run a distanceto calculation comparing list A to list B.
@Marcel_Rijsmus No I’m not using that node since I’m trying to work with elements outside the room I’m focusing on.
@Robert_Younger Yes I am using the room centroid as the location point in which I am basing my geometry for the elements. That part I have figured out. I did get the elements grouped by the parameter value. It’s getting the script to run Room X with elements assigned to Room X, then Y with Y without going back through X.
I’m a little weak on efficient list management practices, but the ‘nothing else is working’ method I fall back to:
*List.Count the bin size of the elements.
*List.Cycle the Room list. This will give you equal-sized, equal-structure lists to compare to the element points list.
if you have all elements, and all elements in room, then subtract
@Marcel_Rijsmus That would work for having one room, but I’m looking to use this for multiple rooms at the same time. I want this to be a universal tool so there’s little prep work to do before running it and I can run it on a high rise where we usually have longer distances and multiple rooms.
Why would this work for just one Room?