Hi everyone. I’m a begginer on dynamo and im having dificulties on getting the level elevation from a list with rooms.
Basically i´m getting the rooms from each level and doing a dictionary, then get the rooms with the same parameter and now i need to get the elevation of the rooms and compare then to get the higher.
Thanks for the help!
Can you explain exactly what the issue is? You have the levels already so you can just get the elevation from them. Is that not what you want?
The problem is that I don’t know how to link the level elevation with the intended room.
The dictionary returns your rooms grouped by level, so you can just get the elevation from the list of levels used on the dictionary. You can then filter the levels along with the matching rooms to have the associated elevation.
That being said, the way more efficient way to go about this is to make the dictionary return the level element from the level name. Then you can just get the rooms, their associated level (name) and then get the element from the name using the dictionary.
2 Likes
Thanks for the help! I will try!
Use the level element to group the rooms and then use the level name to drive a dictionary of rooms and associated elevations - here’s an example
4 Likes
Thanks for the help, I wasn’t using any extensions and that was making things more difficult. The image shows what I wanted.
Apologies for overlooking that the Element.GetLevel node is in the OpenMEP package. There are also nodes from GeniunLoci and Clockwork packages.
You could also use a python node with this code
def get_levels(elems):
if isinstance(elems, list):
return [elem.Level for elem in UnwrapElement(elems)]
return UnwrapElement(IN[0]).Level
OUT = get_levels(IN[0])