FamilySymbol Class


An element that represents a single type with a Family.

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

Syntax

C#
public class FamilySymbol : InsertableObject
Visual Basic
Public Class FamilySymbol _
	Inherits InsertableObject
Visual C++
public ref class FamilySymbol : public InsertableObject

Remarks

Custom families within the Revit API represented by three objects - Family, FamilySymbol and FamilyInstance . Each object plays a significant part in the structure of families. The Family element represents the entire family that consists of a collection of types, such as an 'I Beam'. You can think of that object as representing the entire family file. The Family object contains a number of FamilySymbol elements. The FamilySymbol object represents a specific set of family settings within that Family and represents what is known in the Revit user interface as a Type, such as 'W14x32'. The FamilyInstance object represents an actual instance of that type placed the Autodesk Revit project. For example the FamilyInstance would be a single instance of a W14x32 column within the project.

Examples

Copy C#
public void GetInfo_FamilySymbol(FamilySymbol familySymbol)
{
    string message;
    // Get FamilySymbol family name
    message = "Family name is : " + familySymbol.Family.Name;

    // Get FamilySymbol material
    message += "\nFamilySymbol materials are :";
    foreach (ElementId matid in familySymbol.GetMaterialIds(true))
    {
       Material material = familySymbol.Document.GetElement(matid) as Material;
       if (null != material)
       {
          message += "\n" + material.Name;
       }
    }

    TaskDialog.Show("Revit",message);
}
Copy VB.NET
Public Sub GetInfo_FamilySymbol(familySymbol As FamilySymbol)
   Dim message As String
   ' Get FamilySymbol family name
   message = "Family name is : " & Convert.ToString(familySymbol.Family.Name)

   ' Get FamilySymbol material
   message += vbLf & "FamilySymbol materials are :"
   For Each matid As ElementId In familySymbol.GetMaterialIds(True)
      Dim material As Material = TryCast(familySymbol.Document.GetElement(matid), Material)
      If material IsNot Nothing Then
         message += vbLf + material.Name
      End If
   Next

   TaskDialog.Show("Revit", message)
End Sub

Inheritance Hierarchy

See Also