Original post at: Space-Room coordination
The following workflow uses custom nodes from the packages: “SpringNodes”, “Archi-Lab”, “SteamNodes” and “MEPover”.
There are a few things to consider when managing your spaces:
A: Make sure the levels between the host model and the linked model are aligned;
B: Make sure the levels share the same computation height;
C: Create and coordinate spaces and rooms;
D: Set the limit offset of the spaces.
A. Aligning levels
The first one is easy as this is usually done when setting up your model. I take it everyone knows how to use the copy/monitor function, so let’s skip this step.
B. Set computation heights
If you only have a few levels in your project it is no problem: just manually check the computation height of the linked levels and the host levels and set the same computation height. However, if there are a lot of levels, Dynamo can come in handy. Here’s a simple workflow for setting the level’s computation height:
- Find the levels from both the host model and the linked architectural model
- With a dictionary you can create a list of keys and a list of associated values. In the example above the keys are the elevation values of the levels from the host model and the values are the levels themselves (also from the host model). After that the ‘search keys’ will look up the values associated with those keys.
The level elevation values from the linked model are used to return the levels from the host model. By using this workflow you will be able to match levels from the linked model to levels in the host model. If however there are levels which can’t find a matching height, then a null value will be returned.
- Retrieve the computation height values from the levels in the linked model and use those to set the computation height of the levels in the host model. In this case the SetParameter node gives a warning, because there is a level in the linked model that can’t find a matching level in the host model (like stated in step 2). This doesn’t have to be a problem, just make sure there aren’t any rooms hosted to that level.
If there are rooms hosted to that level then the next steps will fail as the spaces we are going to generate always need to be associated to a level.
C. Space creation and coordination
This is the hardest part. There is no single right way to manage the coordination between your spaces and the rooms from the linked model. If you are not in the same office as the architect it’s almost impossible to keep track of the changes in the linked model. It would mean checking every space that no longer has a matching room number and looking for that room’s new location or it could also have been deleted altogether.
I therefore put some thought into creating a workflow that would work for any situation, regardless of the changes to the rooms. The only prerequisite for this to work well is that every room has a unique room number (sadly I still run into a lot of architectural models with duplicate room numbers, even though Revit gives explicit warnings stating that this is actually a bad idea…).
let’s assume that every space has the same number as the room it is associated with. Now whenever you load a new architetural model, the spaces will retain their space numbers (basically the state of the old architectural model). All you need to do is find the difference between the new rooms and the existing spaces. There’s basically three options to choose from:
1: A room number has been deleted
2: A room number still exists in the model (and might have moved)
3: A room number is new
To gather the information above we can use a really useful data structure known as a ‘Set’.
Sets are a collection of unique items upon which you can perform some functions you can’t do as efficiently with lists. Luckily Dynamo has included a few nodes for working with sets. There are 2 important methods that can be used with sets: ‘SetDifference’ and ‘SetIntersection’. Explaining these is best done through an example:
As you can see, this way it’s possible to find out exactly what we are looking for. Now let’s have a look at the next challenge: associating room/space numbers with actual rooms and spaces. We can achieve this by using a dictionary in which the keys are the space/room numbers and the values are the actual spaces/rooms. The output of the dictionaries will be the data to use for creating, managing or deleting the current spaces. Here is the result (with explanation):
- First gather the rooms, spaces and their respective numbers.
- Use the SetDifference node (room numbers in input 1, space numbers in input 2) in order to have the new room numbers from the linked model returned. Those room numbers are used as input for the dictionary which will return the room elements. Secondly, get those rooms’ locations and use them for the creation of new spaces.
- Use the SetDifference node but reverse the input order (space numbers in input 1 and room numbers in input 2). This way the space numbers for which there is no longer a room number available in the linked model are returned. With the dictionary the space elements are returned. All that’s left is to simply delete these spaces.
- Find out which rooms and spaces with the same numbers are still in both the models, using the SetIntersection node. With the dictionary we retrieve the space elements. Because this doesn’t tell us whether the rooms and spaces are still in the same location, we need to check their locations and then move the spaces if necessary. Sadly Dynamo doesn’t allow moving spaces to different levels with any of the normal nodes. For this reason I created the node: “Space coordination move to associated room”. This node will find the room in the linked document with the same room number as the space. It will check its location and if that location isn’t the same as the space it will attempt to move the spaces to rooms with the same numbers.
After this make sure that the new space numbers change to match the associated room numbers. After that you can repeat this entire workflow for every new linked model update you receive.