Get Name of Family Type Parameter Associated to Nested Family Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For simplicity of explanation, I will use an example of a Family of a Radio with (2) speaker outputs, (1) on the left and (1) on the right. The Radio Family has a nested Speaker Family called "SP" with individual types "SP1, SP2, SP3, etc." the "SP" instance on the left is controlled by a Family Type Parameter "LEFT" and the "SP" instance on the right is controlled by a Family Type Parameter "RIGHT" so that once loaded in the project a radio could be composed of different "SP" types switched out such as a Radio made up as (SP1) L (SP1) R, (SP1) L (SP2) R, (SP2) L (SP2) R and the combos go on....
My question is once this family is loaded and placed, when I select an instance of the Speaker "SP" (not the whole radio but one speaker) is there a method in the Revit API to know which Family Type Parameter it is associated to?
For example, if I select the right speaker instance of a radio, how can I via the API return which Family Type Parameter it is controlled by, in this case "RIGHT"?
While I can (Radio Family Instance).Symbol.LookUpParameter("RIGHT") & ("LEFT") of the main radio family and see which types are assigned, this will become tricky when the same type of "SP" is assigned to both.
Additionally, I suppose if in the family, the speakers were individually hosted to named reference planes, one could retrieve the name of the reference plane the instance is on, however, I would like to make this operational for all families that may not be set up this way.
Any suggestions? Thank you.