Sometimes, when working on projects, particularly multi-residential or retail projects, the planning layout emerges organically. Rooms and corridors are first created based on building-wide constraints such as geometric massing, location of cores, maximum depth of rooms, etc. The resulting areas are then calculated by placing Revit rooms. As the project evolves, these rooms are refined to satisfy the brief requirements. However, to do this, a comparison needs to be established between what is drawn and the brief. While it is possible to go through and manually rename every room to generate a schedule and facilitate this comparison, we can automate the procedure.


Dynamo automation
The example below was developed for multi-residential projects where each apartment type has very clear minimum area requirements.
The graph first collects rooms and extracts their area. In this particular case, the model’s area units and brief requirements are both set to square meters. However, if the area units don’t match, update the ‘Convert By Units’ node accordingly. A simple Python script is then used to establish the thresholds and their corresponding apartment type.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN[0]
studioArea = IN[1]
oneBedArea = IN[2]
twoBedArea = IN[3]
threeBedArea = IN[4]
#Assign your output to the OUT variable
OUT = 0
occupancy = []
for i in dataEnteringNode:
if i < studioArea:
occupancy.append("INVALID")
elif i < oneBedArea:
occupancy.append("STUDIO")
elif i < twoBedArea:
occupancy.append("1 BED")
elif i < threeBedArea:
occupancy.append("2 BED")
elif i >= threeBedArea:
occupancy.append("3 BED")
OUT = occupancy
Finally, the rooms are renamed based on the thresholds:
| Apartment type | Area range |
|---|---|
| Studio | 35-50m2 |
| 1-Bed | 50-69m2 |
| 2-Bed | 70-99m2 |
| 3-Bed | >100m2 |





7 Comments
camille
Hi, this is a good script however I cant seem to make it work. do you have a video tutorial for this? Thank you!
Paul Wintour
No video, sorry. Can you post a link to a screenshot showing the problem. Note that if you are using a different language, you’ll need to update the parameter name.
camille
Thank you for your reply! Im kinda new to dynamo so aplogies for simple question, I tried to use your script, but can’t seem to find these nodes. Are you using a package for these (circles in yellow) and another question, for the highlited in blue, are you just using a number node? Thank you! https://ibb.co/Pmys9z5
Paul Wintour
Those nodes have been renamed. They are select model elements (plural), number, and identity (which actually doesn’t do anything).
cam
I basically copied the dynamo and python script but the python script is not working alongside element.setparameters. https://ibb.co/wMFY8zD
Paul Wintour
I think the issue is that the Python is set up to take a list of rooms, and you are only feeding in a single room. Replace the input node with ‘Select Model Elements’ (instead of Select model Element) and then select multiple rooms. You are also missing inputs to the Python node for the other thresholds.
camille
I updated the script as you mentioned and it works! Thank you! this is an awesome tutorial.