RVTDocs.com
Namespace: Autodesk.Revit.DB Class: Document

Document.GetDefaultFamilyTypeId

Method
Description:
Gets the default family type id with the given family category id.
Syntax
public ElementId GetDefaultFamilyTypeId(
	ElementId familyCategoryId
)
Examples
private void AssignDefaultTypeToColumn(Document document, FamilyInstance column)
{
    ElementId defaultTypeId = document.GetDefaultFamilyTypeId(new ElementId(BuiltInCategory.OST_StructuralColumns));

    if (defaultTypeId != ElementId.InvalidElementId)
    {
        FamilySymbol defaultType = document.GetElement(defaultTypeId) as FamilySymbol;
        if (defaultType != null)
        {
            column.Symbol = defaultType;
        }
    }
}
Parameters
Parameter Type Description
familyCategoryId ElementId The family category id.
Return Value
Type Description
ElementId The default family type id.
Exceptions
Exception Condition
ArgumentNullException A non-optional argument was null