2027 Property
Changes 0
P

Document.ActiveView

Description:
The document's active view.
public View ActiveView { get; }
// Get the active view of the current document.
Autodesk.Revit.DB.View view = document.ActiveView;

// Get the class type of the active view, and format the prompt string
String prompt = "Revit is currently in ";
if (view is Autodesk.Revit.DB.View3D)
{
    prompt += "3D view.";
}
else if (view is Autodesk.Revit.DB.ViewSection)
{
    prompt += "section view.";
}
else if (view is Autodesk.Revit.DB.ViewSheet)
{
    prompt += "sheet view.";
}
else if (view is Autodesk.Revit.DB.ViewDrafting)
{
    prompt += "drafting view.";
}
else
{
    prompt += "normal view, the view name is " + view.Name;
}

// Give the user some information
TaskDialog.Show("Revit",prompt);