LearnRevitAPI

🧐 Check if All Your Doors are tagged with Revit API

Feb 19, 2025
Find Door Without Tags

I've got another Revit API question: ❓How to ensure all doors are tagged on our plans?
That's a good one. I had the same question when I was working on a high-rise project with 35 levels. It wasn't fun to look for missing tags manually, so I had to find a better approach. And that's what I'm about to share with you.
So pull out your magnifying glass, let's look for missing tags.

1. Proof Of Concept
We are going to do this a little different.
Firstly, I want to create a proof of concept by working on the active view. Once it works, we will turn it into a function and use across many views.
That's how I usually code. In the 1st stage I code fast and dirty to get results. It won't be perfect or look good, it just have to do the job. And then we can try to make it better and prettier, no the other was around.
So here is the plan:
Get All Doors in View
Get all Tags in View
Find Tagged Doors
Find Untagged Doors
Pretty straight-forward, let's dive into code.
1.1. Find Untagged Doors in Active View
Firstly, we are going to get all doors and tags from the active view. For that we will use FilteredElementCollector to get elements visible in a view. (Watch This if you are new to FEC)
Here is the code:

Now we can iterate through tags and use GetTaggedLocalEleements to produce a list of tagged doors.
Then, we can get a list of untagged doors by checking door ids in the list of tagged doors.
Here is code:

Lastly, to make it easier to see results, we will change user's selection in Revit UI.
Here is code:

1.2. Final Code - Proof Of Concept
And that's our proof of concept. If you run this full script it will select doors in your view that don't have any visible tags.
Here is full code:

And here is my result. As you can see I have a door without tag selected, so I know it works correctly.

Now let's make it work across multiple views.
2.1 Create a function
Let's begin by creating a function to find untagged doors so we can use it across many views.
Let's wrap out existing code into a function and call it find_untagged_doors(view)

2.2. Select Views
Next, we need to select views where to check doors for missing tags. Luckily, there is an amazing reusable function in pyRevit.forms that makes this step super easy.
Here is the snippet

2.3. Find Doors with Missing Tags
Finally we can iterate through all views and find our missing tags.
I also want to style it nicer, so I will use output.print_md which allow you to print Markdown syntax. This will allow you to print headings, bold text, horizontal lines and so on by using simple symbols. (you can google for examples)
Here is the code for final step:

Get Output
Iterate Through views
Create clickable linkify button for View
Create clickable linkify button for Missing Doors
Add extra print statements.
This step takes more lines of code because we are making a lot of print statements. But overall, it's a very simple code.
What's linkify? Well, it's a super nice feature in pyRevit that allow you to print clickable button that will select provided elements. (You can learn more here)
2.4. Final Code:
Here is the final tool that will save you a lot of time looking for missing door tags.

Now you can adjust very little and create similar tools for other categories. Let me know if you would like a video tutorial for that.
P.S.
If you find it exciting, but you find it a little confusing, that's okay. It probably means that you missed a few basic steps on your programming journey.
If that's the case, I would like to help you cover these basics in no time. Click here to learn more.
Join Newsletter
📩 You will be added to Revit API Newsletter
Join Us!
which is already read by 9500+ people!




