SaveAs Method


Saves the document to a file name obtained from the Revit user without prompting the user ot overwrite a file if it exists.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
public void SaveAs()
Visual Basic
Public Sub SaveAs
Visual C++
public:
void SaveAs()

Remarks

This method may not be called unless all transactions, sub-transactions, and transaction groups that were opened by the API code were closed.

That also implies that this method cannot be called during dynamic updates.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ForbiddenForDynamicUpdateException SaveAs may not be called during dynamic update.
Autodesk.Revit.Exceptions InvalidOperationException Is not a primary document, it is a linked document. -or- SaveAs is temporarily disabled. -or- Thrown if there are any transactions, sub-transactions or transaction groups which were opened by the API code, and not closed. All of these items must be handled before attempting to close the document.
Autodesk.Revit.Exceptions OperationCanceledException Thrown if saving as is cancelled by an external application during 'DocumentSavingAs' event.

See Also