ViewFamily Property


View Family Type View Family Property

The ViewFamily for this view type.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public ViewFamily ViewFamily { get; }

Property Value

ViewFamily
Example
public ViewFamily GetViewFamily(Document doc, View view)
{
    ViewFamily viewFamily = ViewFamily.Invalid;

    ElementId viewTypeId = view.GetTypeId();
    ElementId viewTypeIdOne = new ElementId(1L);
    if (viewTypeId > viewTypeIdOne) // some views may not have a ViewFamilyType
    {
        ViewFamilyType viewFamilyType = doc.GetElement(viewTypeId) as ViewFamilyType;
        viewFamily = viewFamilyType.ViewFamily;
    }

    return viewFamily;
}
See Also
ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →