Share

FamilyManager.Types Property

All family types in the family.


Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)

Syntax

C#

public FamilyTypeSet Types { get; }

Property Value

FamilyTypeSet

Example

C#

public void GetFamilyTypesInFamily(Document familyDoc)
{
    if (familyDoc.IsFamilyDocument)
    {
        FamilyManager familyManager = familyDoc.FamilyManager;

        // get types in family
        string types = "Family Types: ";
        FamilyTypeSet familyTypes = familyManager.Types;
        FamilyTypeSetIterator familyTypesItor = familyTypes.ForwardIterator();
        familyTypesItor.Reset();
        while (familyTypesItor.MoveNext())
        {
            FamilyType familyType = familyTypesItor.Current as FamilyType;
            types += "\n" + familyType.Name;
        }
        TaskDialog.Show("Revit",types);
    }
}

VB

Public Sub GetFamilyTypesInFamily(familyDoc As Document)
    If familyDoc.IsFamilyDocument Then
        Dim familyManager As FamilyManager = familyDoc.FamilyManager

        ' get types in family
        Dim types As String = "Family Types: "
        Dim familyTypes As FamilyTypeSet = familyManager.Types
        Dim familyTypesItor As FamilyTypeSetIterator = familyTypes.ForwardIterator()
        familyTypesItor.Reset()
        While familyTypesItor.MoveNext()
            Dim familyType As FamilyType = TryCast(familyTypesItor.Current, FamilyType)
            types += vbLf + familyType.Name
        End While
        TaskDialog.Show("Revit", types)
    End If
End Sub

See Also

Reference

Was this information helpful?