Architect moved their rooms. Now my room tags are messed up. Tips for fixing room tags?

It is a common but dreaded problem. One that I fear is happening more and more as we are working on the cloud more often. The architect has revised their floorplan. Rooms have been moved. Rooms have been deleted. Worst of all, new rooms have been added. My MEP model is full of question marks, as is my head.

I’ve seen some threads related to automatically tagging rooms in multiple views. Perhaps one could re-tag all rooms? But what if my team has already placed their room tags and moved them to avoid cluttering their drawings? Also, perhaps I don’t want to tag all rooms. Sometimes the architect’s model contains untitled rooms such as “ROOM 1032” that I don’t want to tag.

To help myself fix these room tags, I developed a (messy) dynamo script:


RoomTag_IsOrphaned R2023 v2.dyn (113.9 KB)

It is a huge help. It lists all orphaned room tags, as well as those no longer in the room. Orphaned tags can be deleted all at once. Displaced room tags can be re-centered all at once. One can click on the green element Id’s to show the errant room tags in the model, allowing the user to decide what to do with them. It is easy to fix rooms that were moved or deleted, but I have not come up with a solution for newly added rooms.

Here is the question: Can anyone come up with a way to list the untagged rooms in the active view? Then show them in the model?

I halfway attempted a solution in the above script, but I could only find rooms that have not been tagged in any views. I used a package node to zoom to the room in the active view, but it’s not as useful as Revit’s “Highlight in Model” feature.

Start with Two All Elements of Category In Active View nodes; one to pull the rooms in the view, and one to pull the room tags.
Convert the rooms to element Ids so you have something comparable.
Get the host of the tags (rooms), and convert those to Element Ids as well.
Then use List.SetDifference to pull the element ids of rooms which don’t have a tag.
Lastly get the elements from the list of ids.

Thanks for the response Jacob! That is a very clear explanation.

I was unaware that node existed. I also neglected to make it clear that the rooms are from a linked model. I tried to use the “All Elements of Category in View” nodes like you describe, but the output was an empty list. I was actually able to get a list of linked room elements using this code:

import sys
import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

rmTagsInMepModel = UnwrapElement(IN[0])
linkDocIn = IN[1]

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

taggedRooms = []


if isinstance(IN[0], list):
	for roomTag in rmTagsInMepModel:
		taggedRooms.append(linkDocIn.GetElement(roomTag.TaggedRoomId.LinkedElementId))
else:
	taggedRooms.append(linkDocIn.GetElement(rmTagsInMepModel.TaggedRoomId.LinkedElementId))
	

OUT = taggedRooms

but when you click the element Id, Revit displays the “No good view could be found” warning.

That’s due to it being a linked element, right?

Let me revise my question:

Is there a way to list linked elements in the active view, then show them in the model?

Yes. The hyperlink view navigation requires that the element exist in the active document, as it relies on the bounding box and sequential filtered element collectors for views in the active document as opposed to any document.

As far as linked element collection from a view in a different document… There is not a direct way to do this, so you need to build a work-around. There are a few ways to do it, some of which are tagged in these Revit API forum posts: