public void ExportWarnings() { try { using (StreamWriter writer = new StreamWriter(@"C:\temp\warnings.txt")) { FailureDefinitionRegistry failures = Autodesk.Revit.ApplicationServices.Application.GetFailureDefinitionRegistry(); IList<FailureDefinitionAccessor> failuresList = failures.ListAllFailureDefinitions(); foreach (FailureDefinitionAccessor failure in failuresList) { if (failure.GetSeverity() == FailureSeverity.Warning) writer.WriteLine(failure.GetDescriptionText()); } writer.Close(); } } catch { } }
And the resulting file from Revit 2017 : Warnings.txt
This is great! Is it possible to actual automatically export model warnings from a model with macro or python?
ReplyDeleteWatch for a blog post soon... *wink wink*
DeleteNew post about how to extract Warnings from Revit 2018 is up: http://revitcoaster.blogspot.com/2017/04/revit-2018-export-warnings-from-model.html
DeleteNote, this only works in Revit 2018.