Opens and activates a Revit document.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public UIDocument OpenAndActivateDocument(
string fileName
)
Parameters
- fileName String
-
A full path to a revit file to be opened.
The file can be either a Revit project, template, or family document.
Return Value
UIDocument
The opened document.
Exceptions
Remarks
This method, if successful, changes the active document.
It is not allowed to have an open transaction in the active document when calling this method.
Additionally, this method may not be called from inside an event handler.
See Also
Reference