Generic model family defining category

Generic model family defining category

GeomGym
Advocate Advocate
1,724 Views
4 Replies
Message 1 of 5

Generic model family defining category

GeomGym
Advocate
Advocate

From the API, can I set the family category having started from a generic model template?

 

I recall being told it might be possible in 2014 (maybe I've overlooked and it's possible in earlier versions).

 

At the moment I ship various templates with categories preset.

 

Thanks in advance,

 

Jon

0 Likes
Accepted solutions (1)
1,725 Views
4 Replies
Replies (4)
Message 2 of 5

gopinath.taget
Alumni
Alumni

Hi,

 

I enquired with my colleagues in engineering and they mentioned that this is possible in Revit 2014:

 

*--------

This was enabled in 2014 (from what’s new):

 

Family category

The property

  • FamilyBase.FamilyCategory

 

can now be set.  This allows the category of an family being edited to be changed.

*--------

 

Hope this helps. 

 

Best Regards,

Gopinath Taget

0 Likes
Message 3 of 5

GeomGym
Advocate
Advocate

Hi Gopinath,

 

Thanks for the reply.  I can see this property can now be set, but what I can't see is how to construct a category object to assign.

 

Can you please advise (sorry for the delay in responding, I didn't use to many new categories since posting but looks like I will soon).

 

Thanks,

 

Jon

0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

Hello,

 

Have you looked at this blog post already: http://thebuildingcoder.typepad.com/blog/2012/04/adding-a-category-to-a-shared-parameter-binding.htm...

 

It talks about creating a new category and adding it to a new category set.

 

Cheers

Gopinath

0 Likes
Message 5 of 5

GeomGym
Advocate
Advocate

Thanks, I hadn't seen that post.

 

I just tested and something like this seems to do what I need.

 

famDoc.OwnerFamily.FamilyCategory = famDoc.Settings.Categories.get_Item(BuiltInCategory.OST_PlumbingFixtures);

 

This is great news.  Appreciate your help.

0 Likes