How to get Categories listed?


Hello,

How can i create a list of categories, even when they are not in use?

like i did here with this list stuff

KR

Andreas

Python based solution for you, based on standard boilerplate code, which should get you started. Including a few extra links as I’m guessing they’ll come in handy later. :slight_smile:
Haven’t tested this directly, so pardon any typos.

allCats = doc.Settings.Categories #gets all categories in the document
builtInCats = [ c for c in allCats if c.Parent == None ] #remove all subcategories
subCats = [ c for c in allCats if c.Parent != None ] #remove all non-subcategories
mdlCats = [ c for c in allCats if c.CategoryType == CategoryType.Model ] #remove any non-model categories
3 Likes