How to set an instance "Family Type" parameter of a Family in a Project

I think it does need to be a nested family unfortunately. I haven’t been able to return a list of existing NestedFamilyTypeReferences so far.

EDIT: Finally got it. The family types do not have to be from a nested family. You just have to specify the specific family type parameter that controls the embedded family. (Which may be instance or type based.)

Python Code
import sys
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

inst = UnwrapElement(IN[0])
param = inst.LookupParameter("Size")
family = inst.Symbol.Family
familyTypeIds = family.GetFamilyTypeParameterValues(param.Id)
familyTypes = [doc.GetElement(typeId) for typeId in familyTypeIds]

OUT = familyTypes

This will return all viable family types, not just the ones defined in the family. If you want to filter down to only the embedded options you can filter those types one more time with:
nestedTypes = [familyType for familyType in familyTypes if type(familyType) == NestedFamilyTypeReference]

3 Likes