I am having an issue with our Revit AddIn when Structural Analysis Toolkit 2016 is also installed.
On Revit 2016 when Structural Analysis Toolkit 2016 is installed and if a plugin registers for the event Document.DocumentSaveAs then my revit document gets immediately corrupt when it is saved as.
Note that I am not doing anything inside the delegate that listens to the Document.DocumentSaveAs event. Just registering a delegate corrupts the document.
Also not that this only happens in Revit 2016 and the same code works fine in Revit 2015 with Structural Analysis toolkit 2015.
Following is the code snippet:
document.DocumentSavingAs += OnDocumentSavingAs;
private static void OnDocumentSavingAs(object sender, Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs e)
{
}
Following are the steps to reproduce:
1) Install Structural Analysis Toolkit 2016 on Revit 2016
2) In your own addin subscribe to the Document.DocumentSaveAs event
3) Make sure your plugin loads into revit as expected.
4) With both your plugin as well as SAT 2016 installed, launch Revit and open an new Architectural Template project.
5) Save the project as MyProject.rvt
6) Close the document. Notice that you would get the dialog to save the document again even though you just saved it.
7) Try to open the project again. Notice the message saying "Data in file MyProject.rvt is corrupt and needs to be manually recovered."
Could somebody from Autodesk please confirm this issue and suggest a fix / workaround ?
Thanks !!
Hi Dave,
FYI -
I asked Structural Analysis Toolkit team to take a look your question last Friday as I'm not an expert of this tool myself.
Hi Dave,
Sorry for the late reply. There is a known issue (Revit-92600) and not specific to the Toolkit. I just saw 2017 SP was posted. I believe 2016 R2 update 6 is following anytime soon.
Also, the product team tells that we can also try the following workaround which can help even without installing Update 6:
>>>>
Try to register the handler in the DB application object instead of document object:
application.DocumentSavingAs += OnDocumentSavingAs;
Do it once and on the application level.
<<<<
Could you give it a try and let us know if it resolves the issue?
Can't find what you're looking for? Ask the community or share your knowledge.