How can I sort my categories by discipline?

Hello,

How can i sort my categories by discipline?

import sys
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
cat = doc.Settings.Categories
discipline = [Categories.GetUnitGroup(i) for i in cat]
Nam = []

for i in cat:
	Nam.append(i.Name)
	
OUT = Nam, discipline


discipline = [Categories.Discipline(i) for i in cat]

does not work :frowning:
KR

Andreas


1 Like

Hi Andreas,

I’m not sure that Categories have a Discipline property?

Views definitely do… Discipline Property

Here’s all the properties for categories… Category Properties

Hope that helps,

Mark

1 Like

of course i can sort my categories by discipline!
i don`t know how to do it in Revit/dynamo

@Draxl_Andreas would an excel file help you to filter categories by their names?

1 Like

Can i translate the list to german … i mean “Autodesk Revit” German? :slight_smile:
My wish would be jump in opend Revit between german/english without open/close Revit

Ok, so it looks like that isn’t exposed in the API… Solved: how to get filtered category list? - Autodesk Community

1 Like

Can i not translate it? from English to German and viceversa?

As @Mark.Ackerley stated, the list filter disciplines aren’t available and aren’t actually a property of the categories themselves. In fact, some categories are assigned to multiple disciplines. You would have to manually define the disciplines yourself.

And how about the the translation? German/english

That I’m not sure about. That would be a separate issue.

1 Like

@Draxl_Andreas check this, using googletranslate function from google sheets
ModelCategories_DE.xlsx (22.2 KB)

1 Like

i got it is fine!

just German tranlation is missing!
i started a new topic

1 Like

How can i get group discipline? see below image

image

Hi @Draxl_Andreas you can try it on RIR of latest version as an alternative way of solution.

I found the solution for this

Is there a way to do this in Dynamo Python?