One of the difficulties of documenting in Revit is the inability to place rooms precisely in the centre of the room. Ideally, Revit would automatically snap to the centroid when in the process of placing a room. Instead, Revit just aligns adjacent elements. Since the reference crosshairs of the room are turned off by default, initially the position of the room may seem irrelevant. However, when attempting to ‘tag all not tagged’, Revit will place tags centred to the room’s location. This constraint means that drawings can appear messy and illegible. To solve this problem, Parametric Monkey has developed two custom Dynamo nodes. Both nodes are available via the Parametric Monkey Dynamo package.
The ‘Room.CentreLocation‘ node moves all rooms within the project to the centroid of the room. If you have an odd-shaped room, and the centroid is going to fall outside of the room boundary, the node will keep the room in its current position. Under the hood, the script collects all rooms within the project and their associated boundary. The centroid of the boundary is then calculated, and a containment test performed to test whether the new location (centroid) is contained within the room. If true, the rooms are moved to their new position with the rest remaining as-is.
Centring room tags
Once all the room have been repositioned, it is possible to move any existing room tags to the new room location point. While it is possible to use the ‘tag all not tagged’ command within Revit, you may have some rooms that either don’t need tags or which require a different tag family. By using Dynamo and referencing the tags already placed in the project, users have greater control over the outcome.
The ‘RoomTag.MoveToRoomLocation‘ node is based on the script by Modelical. However, the benefit of using this node is that it will automatically select all the room tags in the project.
Repositioned rooms and room tags
The problem with having to select which tags to update manually is as follows. Firstly, using the ‘Select model elements’ node in Dynamo, you need to draw a window to reference Revit elements. It is not possible to have a pre-selection or use Ctrl to select multiple elements. The alternative, therefore, is to isolate the room tags for easy selection. However, it is not possible to isolate the room tag category solely. For room tags to be visible, rooms must also be visible. Therefore, having the script collect the room tags automatically is preferable.
Note that the script will search for any tags that contain the term ‘Room Tag’ in the family name. If you name your families something different, you’ll need to modify the node as necessary.