Subscribe to the ViewActivating event to be notified when Revit is just about to activate a view of a document.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 2010
Syntax
C# |
---|
public event EventHandler<ViewActivatingEventArgs> ViewActivating |
Visual Basic |
---|
Public Event ViewActivating As EventHandler(Of ViewActivatingEventArgs) |
Visual C++ |
---|
public: event EventHandler<ViewActivatingEventArgs^>^ ViewActivating { void add (EventHandler<ViewActivatingEventArgs^>^ value); void remove (EventHandler<ViewActivatingEventArgs^>^ value); } |
Remarks
This event is raised when Revit is just about to activate a view of the document.
Event is not cancellable. The 'Cancellable' property of event's argument is always False. Your application is responsible for providing feedback to the user about the reason for the cancellation.
The document may be modified during this event.
The following API functions are not available for the current document during this event:
- Close()()()() and similar overloads.
- Save()()()() and similar overloads.
- SaveAs(String) and similar overloads.
Exception InvalidOperationException will be thrown if any of the above methods is called during this event.
Another ViewActivated event will be raised immediately after view activating is finished.