DocumentOpening Event


Subscribe to the DocumentOpening event to be notified when Revit is just about to open a document.

Namespace: Autodesk.Revit.ApplicationServices
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2010

Syntax

C#
public event EventHandler<DocumentOpeningEventArgs> DocumentOpening
Visual Basic
Public Event DocumentOpening As EventHandler(Of DocumentOpeningEventArgs)
Visual C++
public:
 event EventHandler<DocumentOpeningEventArgs^>^ DocumentOpening {
	void add (EventHandler<DocumentOpeningEventArgs^>^ value);
	void remove (EventHandler<DocumentOpeningEventArgs^>^ value);
}

Remarks

This event is raised when Revit is just about to open a document.

Event is cancellable. To cancel it, call the 'Cancel()' method in event's argument to True. Your application is responsible for providing feedback to the user about the reason for the cancellation.

The document cannot be modified, for it is not opened yet at the time of the event.

Another DocumentOpened event will be raised immediately after document is opened.

See Also