I’m building a Dynamo script to number doors based on the room they’re in. I’m able to read the FromRoom and ToRoom parameters through a Python snippet I found somewhere, and I’m passing the number and name of the rooms to custom shared parameters on the door (OPA_RoomA_Number and OPA_RoomA_Name, same for RoomB) which can then be displayed on a tag as desired.
A problem arises when I’m trying to “reset” the room name and number before setting the actual room numbers back into the doors. I need to do this because when a room is deleted or a door is copied to a spot that has no room on the other side, the door maintains the previous room name and number in its custom parameters even after the Dynamo script has been run. This is dangerous since it’s then possible to have wrong room numbers on door tags. So I thought I’d first replace all custom parameters with a “-” string using Element.SetParameterByName, and then run the python script and set the parameter accordingly from the FromRoom or ToRoom parameter with another SetParameterByName.
This doesn’t always work. I’m assuming it’s to do with node execution order. Since I’m manipulating the same parameter twice, sometimes some doors FIRST change the FromRoom parameter value, and THEN replace it with the blank value even though the reset operation occurs first in the node flow. Is there a way to ensure that nodes are executed in the right order? I tried Transaction.End but I’m not sure I understand how it’s supposed to work.
Attached is a screenshot of the Dynamo definition, and a door between two rooms that only reads the number and name of ONE of the rooms. As you can see the lower room is absent from the door’s parameters, even though the door on the left correctly reads the room number (111)
The yellow nodes are because some doors don’t necessarily have FromRoom or ToRoom (these are exterior doors) so the room lists end up with null references. I’ve worked around this but as a sidenote it would be nice to be able to ignore null references and pass on null values in these situations (I wouldn’t have to manually reset the “empty” FromRoom or ToRoom if that was the case).
Dynamo version 188.8.131.524, Revit 2017. Thanks for any help you can offer!