System Versus User Family Category

Here is a simple question and suggestion on classifying categories into built-in system versus user defined.

Question: Given an arbitrary element, how can I determine whether it belongs to a system family as opposed to a user-defined family?
I thought I might look at its category, but how can I see whether that is system-defined?
For example, I see that a duct has a category id of -2008000.
Can I depend on the fact that this category id value is negative?
Or is there any other way to determine this?

Answer: There is currently no API method to distinguish system categories from user defined ones short of creating your own hardcoded list.
All built-in categories have negative values, but this includes system family types, family types, and subcategories of each, so that will not help you resolve this issue.

How could such a list be created?

Unfortunately, that would have to be done manually.
This Family Category and Parameters dialogue lists all the family based categories:

Family categories

If the category is a top level category and not in this list, then it is probably a system family category.


Comments

3 responses to “System Versus User Family Category”

  1. Jeremy,
    Out of curiousity – on an element basis – is it true that the “ObjectType” of a given element will be a FamilySymbol for any User Family Category, and not a FamilySymbol for any system family category?
    Thanks,
    Matt

  2. Dear Matt,
    I don’t know off the top of my head, so I asked the development team, and Harry replied in a very similar vein:
    I don’t know the answer off the top of my head for this. Could you send the code that you used to test this theory?
    Cheers, Jeremy.

  3. Dear Matt,
    I was too fast, here is another update, from Scott:
    Probably not true – in place families assigned category “wall” should return a FamilySymbol even though wall is typically a system family category.
    Cheers, Jeremy.

Leave a Reply to Matt MasonCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading