Opens and activates a Revit document.
Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2012
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- fileName
- Type: SystemString
A full path to a revit file to be opened. The file can be either a Revit project, template, or family document.
Return Value
The opened document.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.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.ExceptionsArgumentException | The given 'fileName' is not a Revit file (a project, template, or family document). |
Autodesk.Revit.ExceptionsArgumentNullException | If a null reference (Nothing in Visual Basic) is passed as 'fileName'. -or- A non-optional argument was null |
Autodesk.Revit.ExceptionsFileArgumentNotFoundException | The file specified by 'fileName' cannot be found. |
Autodesk.Revit.ExceptionsInvalidOperationException |
|
Autodesk.Revit.ExceptionsRevitServerCommunicationException | If there is any server internal error. |