Acquiring Room Numbers and Setting them to Doors - Inconsistent Result

I have a Dynamo script in Revit that assigns the room numbers to doors with shared parameters ToRm and FromRm. I have created door families that use the ToRm and FromRm shared parameters. I created a fresh floor plan and everything works fine. However, on an older floor plan that has been edited with room number changes only the FromRm parameter sets correctly. The script runs by acquiring the door elements, getting the ToRooms and FromRooms data (Get To-From Room), getting the parameter values (Element.GetParameterValueByName), and finally setting the parameters back to the ToRm and FromRm shared paramters (Element.SetParameterByName). Any idea what is wrong? I have attached a screen shot:

1 Like

I think you’re running into the limitation of Revit’s From/To room numbering. Those values are set when the door is placed and don’t automatically change when the doors is flipped in the wall making it pretty useless, IMO.

Greg and Efajo -

Thank you for both taking a look at this. I can still access my shared parameters and manually make the change. My hope was Dynamo could change each door and I would not have to do this manually. If anyone is interested the background on this is I am trying to maximize our square footage reimbursement by including the door thresholds. The script I have a Yes/No parameter that I check to tell Revit to use either the ToRm or FromRm number. For example, if a door is opening into an office from a corridor I want to use the ToRm number since the office is billable. For an office with 10 floors and around 75 doors a floor the thresholds will add up.

Mike DuLaney


Thanks for going further and looking at this. I really appreciate the extra effort. I don’t know how I missed this as I had researched trying to associate the doors with the correct rooms prior to diving into Dynamo. Anyway, it was a good learning experience for me and opened up other areas for me in Dynamo.


The problem with the room calculation point is that you can’t move it in the project. A door can swing into or out of a room and still belong to that room. That’s what handed, and reverse handed doors are all about. If we could manually flip the RCP and the door swing separately, we’d be in business… but we can’t.