Hello,
I had a script in Dynamo of assigning Room Name Parameter Data to Area Name Parameter.
But, there were Phases Filter nodes in it, which I deleted as I didn’t need those, but the script gives a lot of warnings and doesn’t run.
Can you help me with the script, I do not want the Phases Filter as my Project is in a single phase.
It’s not allowing me to attach the .dyn file or script.
@jacob.small
Room name to Area Name Parameter.dyn (51.6 KB)
Room name to Area Name - Original with Phases.dyn (74.9 KB)
Welcome to the forum @Khush.P.
I bumped your trust level so you should be able to attach files once your cache clears. If not or if the files are too large you can use a 3rd party service like onedrive, Dropbox, Google drive, box, etc…
Thanks @jacob.small
I have attached both files for reference.
Room Name to Area Name.dyn (20.9 KB)
@jacob.small I tested this script, it gives the Room names to Area Names but not at correct locations. The names fall in randomly, they don’t match.
Can you please help me with it of what i am doing wrong here?
Hey - sorry for not replying earlier. I’m traveling this week and as such only have a phone for stuff like this until Monday. If I get enough service in my travel I can try to have a look, but it might be a bit.
One thing to check is that the areas and rooms are all placed, and that some type of relationship (geometric or otherwise) is being built up.
Went to dig into this today and found that we don’t have a Revit file. As such:
- We can only guess if this is for Revit 2022, 2023, 2024, or 2025
- We can only assume you’ve got all areas perfectly aligned to rooms
- We can only assume that everything is on the same phase and there is no existing conditions phase
- We can only assume you’ve got only a single area
- We can only assume that everything is on the same level
All of that said, the issue is that you don’t have any form of spatial alignment - that is you don’t have a means for associating the area to a room, or the room to an area. As such when you use AllElementsOfCategory you’re getting the rooms in their order of creation, then the areas in their order of creation, and so the Oldest area gets the value from the Oldest room, even though the oldest area might have been made in a completely different location. You can see how this plays out in the model screenshot below. I first changed the room name to include the Element Id so that we can look over the order of selection using the “OfCategory” method, and then I moved the Number parameter from the room to the area using the order of selection as you had. Finally I displayed both the room and area tags in the same view.
This is the Dynamo graph to move stuff over - as seen above it’s not of much use.
What needs to happen is first a geometric relationship between the rooms and areas needs to be created. For this you can use Python, some custom nodes, or the “Room.IsInsideRoom” node. If there is a LOT of rooms or areas this might be ineffective due to the number of tests, but generally it works to a reasonable scale.
Here’s an example implementation:
WIth that group added in suddenly the results look much better:
Note that there are a BUNCH of added filters you’ll need to take into account, including but not limited to:
- Unplaced or unbound areas and rooms
- Area schemes
- Areas placed in room A but covering rooms A, B, and C
- Areas placed where there is no room (site stuff!)
- Areas and rooms in different files
- Areas at differing levels
- Phasing (you can never have NO phasing - avoiding it is usually an over simplification)
Depending on how complex you may want to look into other geometric relationships, such as building a solid for the areas and intersecting them with the room solids after applying some filters.