Since I started working with Revit in 2017 I have been encountering with an issue related to saving a file using the API. The problem happens when calling to “Save” and “SaveAs” methods. And it occurs randomly. When fails,
Revit throws an InvalidOperationException with the message "save failed". As a workaround, what I've been doing is calling the function repetitively until it saves successfully. This is the function I use:
This solves the problem when you only have to save a single file for each execution. The problem is that I am now developing a project in which we need to open, edit and save more than 100 files in each execution and the saving process lasts half of the command’s execution time, which usually takes between 15 and 20 minutes. Moreover, from time to time Revit crashes at this same point without leaving any log.
Does anyone know what may be happening?
Thanks in advance