Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#this script lists the BuiltInCategories currently loaded in a Revit document
#can be easily tweaked to instead list categories only
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
import System
doc = DocumentManager.Instance.CurrentDBDocument
#get list of categories loaded in the document
categories = doc.Settings.Categories
builtincats = []
for c in categories:
bic = System.Enum.ToObject(BuiltInCategory, c.Id.IntegerValue)
builtincats.append(bic.ToString())
builtincats.sort()
OUT = builtincats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment