Types Property


All family types in the family.

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

Syntax

C#
public FamilyTypeSet Types { get; }
Visual Basic
Public ReadOnly Property Types As FamilyTypeSet
	Get
Visual C++
public:
property FamilyTypeSet^ Types {
	FamilyTypeSet^ get ();
}

Examples

Copy 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);
    }
}
Copy VB.NET
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

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →