Opens and activates a Revit document.
Namespace: Autodesk.Revit.UI
Assembly: 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
UIDocumentThe opened document.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | The given 'fileName' is not a Revit file (a project, template, or family document). |
| ArgumentNullException | If null is passed as 'fileName'. -or- A non-optional argument was null |
| FileArgumentNotFoundException | The file specified by 'fileName' cannot be found. |
| InvalidOperationException |
|
| RevitServerCommunicationException | If there is any server internal error. |
