View.ViewType Property

ViewViewType Property

The type of the view.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public ViewType ViewType { get; }
Public ReadOnly Property ViewType As ViewType
	Get
public:
property ViewType ViewType {
	ViewType get ();
}
member ViewType : ViewType with get

Property Value

ViewType
Example
public void GetViewType(Autodesk.Revit.DB.View view)
{
    // Get the view type of the given view, and format the prompt string
    String prompt = "The view is ";

    switch (view.ViewType)
    {
        case ViewType.AreaPlan:
            prompt += "an area view.";
            break;
        case ViewType.CeilingPlan:
            prompt += "a reflected ceiling plan view.";
            break;
        case ViewType.ColumnSchedule:
            prompt += "a column schedule view.";
            break;
        case ViewType.CostReport:
            prompt += "a cost report view.";
            break;
        case ViewType.Detail:
            prompt += "a detail view.";
            break;
        case ViewType.DraftingView:
            prompt += "a drafting view.";
            break;
        case ViewType.DrawingSheet:
            prompt += "a drawing sheet view.";
            break;
        case ViewType.Elevation:
            prompt += "an elevation view.";
            break;
        case ViewType.EngineeringPlan:
            prompt += "an engineering view.";
            break;
        case ViewType.FloorPlan:
            prompt += "afloor plan view.";
            break;
        case ViewType.Internal:
            prompt += "Revit's internal view.";
            break;
        case ViewType.Legend:
            prompt += "a legend view.";
            break;
        case ViewType.LoadsReport:
            prompt += "a loads report view.";
            break;
        case ViewType.PanelSchedule:
            prompt += "a panel schedule view.";
            break;
        case ViewType.PresureLossReport:
            prompt += "a pressure loss report view.";
            break;
        case ViewType.Rendering:
            prompt += "a rendering view.";
            break;
        case ViewType.Report:
            prompt += "a report view.";
            break;
        case ViewType.Schedule:
            prompt += "a schedule view.";
            break;
        case ViewType.Section:
            prompt += "a cross section view.";
            break;
        case ViewType.ThreeD:
            prompt += "a 3-D view.";
            break;
        case ViewType.Undefined:
            prompt += "an undefined/unspecified view.";
            break;
        case ViewType.Walkthrough:
            prompt += "a walkthrough view.";
            break;
        default:
            break;
    }

    // Give the user some information
    TaskDialog.Show("Revit",prompt);
}
Public Sub GetViewType(view As Autodesk.Revit.DB.View)
    ' Get the view type of the given view, and format the prompt string
    Dim prompt As [String] = "The view is "

    Select Case view.ViewType
        Case ViewType.AreaPlan
            prompt += "an area view."
            Exit Select
        Case ViewType.CeilingPlan
            prompt += "a reflected ceiling plan view."
            Exit Select
        Case ViewType.ColumnSchedule
            prompt += "a column schedule view."
            Exit Select
        Case ViewType.CostReport
            prompt += "a cost report view."
            Exit Select
        Case ViewType.Detail
            prompt += "a detail view."
            Exit Select
        Case ViewType.DraftingView
            prompt += "a drafting view."
            Exit Select
        Case ViewType.DrawingSheet
            prompt += "a drawing sheet view."
            Exit Select
        Case ViewType.Elevation
            prompt += "an elevation view."
            Exit Select
        Case ViewType.EngineeringPlan
            prompt += "an engineering view."
            Exit Select
        Case ViewType.FloorPlan
            prompt += "afloor plan view."
            Exit Select
        Case ViewType.Internal
            prompt += "Revit's internal view."
            Exit Select
        Case ViewType.Legend
            prompt += "a legend view."
            Exit Select
        Case ViewType.LoadsReport
            prompt += "a loads report view."
            Exit Select
        Case ViewType.PanelSchedule
            prompt += "a panel schedule view."
            Exit Select
        Case ViewType.PresureLossReport
            prompt += "a pressure loss report view."
            Exit Select
        Case ViewType.Rendering
            prompt += "a rendering view."
            Exit Select
        Case ViewType.Report
            prompt += "a report view."
            Exit Select
        Case ViewType.Schedule
            prompt += "a schedule view."
            Exit Select
        Case ViewType.Section
            prompt += "a cross section view."
            Exit Select
        Case ViewType.ThreeD
            prompt += "a 3-D view."
            Exit Select
        Case ViewType.Undefined
            prompt += "an undefined/unspecified view."
            Exit Select
        Case ViewType.Walkthrough
            prompt += "a walkthrough view."
            Exit Select
        Case Else
            Exit Select
    End Select

    ' Give the user some information
    TaskDialog.Show("Revit", prompt)
End Sub

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