FamilySymbol

The FamilySymbol class represents a single Type within a Family.

Each family can contain one or more family symbols. Each FamilyInstance has an associated FamilySymbol which can be accessed from its Symbol property.

Thermal Properties

Certain types of families (doors, windows, and curtain wall panels) contain thermal properties as shown in the Type Properties window below for a window.

The thermal properties for a FamilySymbol are represented by the FamilyThermalProperties class and are retrieved using the FamilySymbol.GetThermalProperties() method. The FamilyThermalProperties for a FamilySymbol can be set using SetThermalProperties(). The properties of the FamilyThermalProperties class itself are read-only.

The units for the calculated values are shown in the table below.

Property

Unit

HeatTransferCoefficient

watts per meter-squared kelvin

(W/(m^2*K)

ThermalResistance

meter-squared kelvin per watt

((m^2*K)/Watt)

The AnalyticConstructionTypeId property is the construction gbXML type and returns the value that corresponds to the 'id' property of a constructionType node in Constructions.xml. The static FamilyThermalProperties.Find() method will find the FamilyThermalProperties by the 'id' property of a constructionType node in Constructions.xml.

FamilyType Parameters

Some parameters for a FamilySymbol may be FamilyType parameters. For these parameters, the Family.GetFamilyTypeParameterValues() method can be used to get all applicable values for the parameter. The values returned are ElementIds of all family types that match the category specified by the definition of the given parameter. The elements are either of class ElementType or NestedFamilyTypeReference. The second variant is for the types that are nested in families and therefore not accessible otherwise. The NestedFamilyTypeReference element stores only basic information about the nested FamilyType, such as the name of the Type, name of the Family, and a Category. These elements are very low-level and thus bypassed by standard element filters, so the main way to get them is via the Family.GetFamilyTypeParameterValues() method.

The following example demonstrates how to get all the family type parameter values for a FamilyType parameter of a FamilySymbol. The value for the parameter is then changed to another value. This change affects all FamilyInstances using the loaded FamilySymbol.

Code Region: Get nested FamilyTypes

public void GetNestedFamilyTypes(FamilyInstance instance)
{
    // find one FamilyType parameter and all values applicable to it

    Parameter aTypeParam = null;
    ISet<ElementId> values = null;

    Family family = instance.Symbol.Family;

    foreach (Parameter param in instance.Symbol.Parameters)
    {

        if (param.Definition.ParameterType == ParameterType.FamilyType)
        {

            aTypeParam = param;

            values = family.GetFamilyTypeParameterValues(param.Id);

            break;
        }
    }

    if (aTypeParam == null)
    {
        TaskDialog.Show("Warning", "The selected family has no FamilyType parameter defined.");
    }
    else if (values == null)
    {
        TaskDialog.Show("Error", "A FamilyType parameter does not have any applicable values!?");
    }
    else
    {
        ElementId newValue = values.Last<ElementId>();

        if (newValue != aTypeParam.AsElementId())
        {

            using (Transaction trans = new Transaction(instance.Document, "Setting parameter value"))
            {
                trans.Start();
                aTypeParam.Set(newValue);
                trans.Commit();
            }
        }
    }
}