Hi,
you could iterate over the BuiltInParameter enum values.
For each BuiltInParameter, you could check if it is existing on your Element.
static List<BuiltInParameter> GetBuiltInParametersByElement(Element element)
{
List<BuiltInParameter> bips = new List<BuiltInParameter>();
foreach (BuiltInParameter bip in BuiltInParameter.GetValues(typeof(BuiltInParameter))
{
Parameter p = element.get_Parameter(bip);
if (p != null)
{
bips.Add(bip);
}
}
return bips;
}
Note that even if there are two Elements of the same category, saying two FamilyInstances of BuiltInCategory.OST_Windows,
it may be that one of them has got a given BuiltInParameter while the other one doesn't have.
Also, depending on how a Family has been constructed, a BuiltInParameter may be existing but without having a useful value.
For example, you can have different window families in your project file.
If you check the BuiltInParameter.WINDOW_WIDTH, it may be that this can be found twice, both as an element parameter and as a type parameter.
As an element parameter, it may return a value of 0. That means: the parameter is existing, not null, but does not provide a plausible value.
In this case, the type parameter BuiltInParameter.WINDOW_WIDTH may provide a realistic result.
Use RevitLookup to inspect your elements.
It displays the available BuiltInParameters and shows the mapping of the relating localized names.
Revitalizer