DocumentActiveView Property |
The document's active view.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntaxpublic View ActiveView { get; }Public ReadOnly Property ActiveView As View
Get
public:
property View^ ActiveView {
View^ get ();
}member ActiveView : View with get
Property Value
ViewThe active view is the view that last had focus in the UI.
if no view is considered active.
Example
Autodesk.Revit.DB.View view = document.ActiveView;
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;
}
TaskDialog.Show("Revit",prompt);
See Also