Revit API Forum
Welcome to Autodeskā€™s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

How to access the elements of the Nested family?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
1315 Views, 5 Replies

How to access the elements of the Nested family?

I met a nested family object built in the Revit structure, which consists of several lamps.

I want to change the illumination and color of these lamps by the Revit API, how can I do it?

5 REPLIES 5
Message 2 of 6
jeremytammik
in reply to: Anonymous

Call EditFamily to open the family definition as a separate document.

 

Modify the family definition, and then reload it.

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.23.3

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 6
RPTHOMAS108
in reply to: Anonymous

There are two types of nested family i.e. shared and non-shared:

 

A shared nested family exists in it's own right in the project document even though it is nested into another family. I believe also this is independent of nesting level.

 

This mainly means:

  1. It can be accessed by the method FamilyInstance.GetSubComponentIds likewise the host family can be accessed the other way via FamilyInstance.SuperComponent
  2. Instance geometry for the nested family is not included in the geometry of the host family 
  3. Type parameters for the nested family can be accessed directly in the project

When a non-shared family is nested it can't be accessed the ways above directly in the project. The instance geometry of the host also contains the geometry of the nested family.

 

If you can tab into the family from the project then it is shared.

 

You may need to edit the family in either circumstance depending on the authored behaviour of the family. Items such as colours (materials) often need to be selected from a predefined list. The obvious choice for a family author would have been to add material parameters to the family and change such things in the project.

Message 4 of 6
Anonymous
in reply to: jeremytammik

Thanks for your very much !

Could please give me some example?

Message 5 of 6
Anonymous
in reply to: RPTHOMAS108

Thank your very much !

Could please give me some example?

Message 6 of 6
Anonymous
in reply to: jeremytammik

I found your another topic about modifying and saving family.
Your mean to modify the family file (.rfa) directly from API ?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Rail Community