Open Revit Document and close it immediately if even one little error is found

Open Revit Document and close it immediately if even one little error is found

FrankHolidaytoiling
Advocate Advocate
219 Views
2 Replies
Message 1 of 3

Open Revit Document and close it immediately if even one little error is found

FrankHolidaytoiling
Advocate
Advocate

If i am in an open document and invoke this

doc = uiApp.Application.OpenDocumentFile(modelPath, openOptions);

if even one error exists immediately close the file without saving.

0 Likes
220 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Your question is not clear to me. What do you want to know? What do you want to achieve?

    

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

FrankHolidaytoiling
Advocate
Advocate

from a list of Revit documents, I would like to open a Revit 2021+ document from a currently opened revit 2021+ document and if any warnings are encountered swallow and continue to open the document. if the document has any error severity warnings, use the close without save argument and conintue opening revit documents. I would log the error of course in the loop if that error severity level warning condition is encountered.