How to get only Family Parameters in a Family Document

Hi guys. Is there a way to only get the family parameters in a family document? My code is like this:

result = []
if doc.IsFamilyDocument:
    for param in doc.FamilyManager.Parameters:
        result .append(param)

The ‘Parameter’ property returns all parameters in a family including ‘family parameter’, ‘shared parameter’, and ‘builtIn parameter’ but I just want ‘family parameter’. I can filter the shared parameter by ‘IsShared’ property but I don’t know how to filter the ‘builtIn parameter’.
Please help me with this problem. Thank you.

You can filter for a BuiltInParameter with a helper function like this

def IsBIP(param):
    return param.Definition.BuiltInParameter != BuiltInParameter.INVALID

Or using the ForgeTypeId schema

def IsBIP(param):
    return ParameterUtils.IsBuiltInParameter(param.Definition.GetTypeId())
1 Like

@Mike.Buttery It worked well. Thanks a lot.

1 Like