BuiltInCategory ennumeration in Revit 2025

Hi there,
I am trying to retrieve for Revit 2025 the list of all built in categories. In Revit 2025, the code used for that purpose in former versions doesn’t seems to work…

So the code used until Revit 2024 was:

bic = System.Enum.GetValues(BuiltInCategory)

But It throws the error :

TypeError : No method matches given arguments for GetValues: (<class ‘CLR.CLR Metatype‘>) [’ File “”, line 47, in \n‘]

I have no clue how to deal this topic. As fas as I know enummerations have been changing during last versions. Thanks for your help.

In order to answer well I have to ask… why?

Usually it’s curiosity, which is good. But I wouldn’t recommend using the resulting list for project uses as it’s slower than it should be (enums exist for a reason after all).

It’s often the case that you’re better off going at the categories in the document - this can be done via doc.Settings.Categories which can be further filtered to get only the built in categories in your document (filtering out any which are custom subcategories in the document). This means you only have the categories which are relevant to your project rather than ALL categories (i.e. nothing specific to the family authoring environment is included in your list) - not that I can think of any offhand for a project, but these are certainly relevant to family environments.

1 Like

it’s an overload issue with (CPython3/PythonNet2), there are 2 methods with Net8+

you can use bic_values = System.Enum.GetValues[BuiltInCategory]() instead

Alternatively, you can use PythonNet3 or Ironpython3 engines (without issues).

2 Likes

Thanks for your answer Jacob.
It’s a question of controlling what Revit has and to document it for company porposes.
Being document dependent it’s not the best way to understand how the database works and what it has to offer… as I work in many disciplines it is always good to have the ability to retrieve all the values from the revit db.
As you say, for an specific project I won’t be iterating all over 1200 bics to get for exemple an specific property .

1 Like

Why not use the documentation then? @c.poupin’s method is your best path for building your own documentation though.

One thing to note: the problem with trying to self document like this is that the BIC can also update based on your Revit version, not just the annual release.

1 Like

Thanks for your answer c.popin. That worked perfect. As Revit 2025 work only with cpython3 the red lined alternative is the good one for me. Thanks again.

I was somehow with the answer but I didn’t interpret it well.

1 Like

The Revit API documentation sometimes lacks clear instructions for non-professional programmers… For me, it’s a good way to keep track of what I’m trying to do and keep learning. I will write a function, as always in these cases, to use each of the syntaxes depending on the version of Revit built. Thanks for your inputs Jacob.

1 Like