Family.Category vs Family.FamilyCategory

Family.Category vs Family.FamilyCategory

H.echeva
Advocate Advocate
1,188 Views
2 Replies
Message 1 of 3

Family.Category vs Family.FamilyCategory

H.echeva
Advocate
Advocate

Hello,

 

Can someone explain to me what the difference is between Family.Category and Family.FamilyCategory . I see that Family.Category is inherited from Element but the documentation is not very clear and I spent a lot of time in a macro because I was not using FamilyCategory.

Accepted solutions (1)
1,189 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni
Accepted solution

Yes. Very sorry about that. The Revit API has grown historically and keeps growing. Not everything is perfectly documented every step of the way. That causes issues like you describe. Very sorry that you ran into that. I cannot explain why things are as you describe, but can confirm them. In the far distant past, it was tricky to determine the family category, because the Family.Category was often not properly populated. Back then, the easiest way to work around that was to use the family symbol Category property instead, via the base Element classCategory property:

  

https://www.revitapidocs.com/2023/8990bd36-af08-fc99-496b-f94fcb056b21.htm

  

This is an issue that you often run into pretty early on, as soon as you dive into the Revit API and start exploring families, symbols and instances in any depth.

  

Personally, I encountered it in January 2009 and documented in The Building Coder blog post number 63, i.e., very early on in my Revit API career:

  

https://thebuildingcoder.typepad.com/blog/2009/01/family-category-and-filtering.html

  

That article incudes a complete explanation that pretty much covers it all.

  

Interesting how long it took you to discover and raise this issue. In the future, I suggest researching a bit. Many problems have already been encountered and solved in the past. It is often quicker to search for existing solutions than to raise the question yet again and then wait for someone to come along and answer it (yet again).

    

Good luck and best regards,

  

Jeremy

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

H.echeva
Advocate
Advocate

Thanks Jeremmy, 

That explains it!

In my defense I did Google it and searched here in the Forum. However, I have the impression that Google's results are not as good as they used to be. 

I admit that I didn't look in your blog, which I should have.

Many thanks!

0 Likes