SaveAs Method (UISaveAsOptions)


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

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2016

Syntax

C#
public void SaveAs(
	UISaveAsOptions options
)
Visual Basic
Public Sub SaveAs ( _
	options As UISaveAsOptions _
)
Visual C++
public:
void SaveAs(
	UISaveAsOptions^ options
)

Parameters

options
Type: Autodesk.Revit.UIUISaveAsOptions
UI options for the SaveAs operation.

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

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsForbiddenForDynamicUpdateException SaveAs may not be called during dynamic update.
Autodesk.Revit.ExceptionsInvalidOperationException 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 save the document.
Autodesk.Revit.ExceptionsOperationCanceledException Thrown if saving is cancelled by an external application during 'DocumentSavingAs' event.

See Also