ViewFamilyType.ViewFamily Property

ViewFamilyTypeViewFamily 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; }
Public ReadOnly Property ViewFamily As ViewFamily
	Get
public:
property ViewFamily ViewFamily {
	ViewFamily get ();
}
member ViewFamily : ViewFamily with 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;
}
Public Function GetViewFamily(doc As Document, view As View) As ViewFamily
    Dim viewFamily__1 As ViewFamily = ViewFamily.Invalid

    Dim viewTypeId As ElementId = view.GetTypeId()
    Dim viewTypeIdOne As ElementId = New ElementId(1L)
    If viewTypeId > viewTypeIdOne Then
        ' some views may not have a ViewFamilyType
        Dim viewFamilyType As ViewFamilyType = TryCast(doc.GetElement(viewTypeId), ViewFamilyType)
        viewFamily__1 = viewFamilyType.ViewFamily
    End If

    Return viewFamily__1
End Function

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also