All, Is it possible via the API to return the total number of warnings in a project? Thanks, Dale
Solved! Go to Solution.
Solved by arnostlobel. Go to Solution.
Unfortunatelly, Revit does not have such an API. Users can get failures that occur during active transactions only.
Thanks for the reply. Even though you say the API does not expose warnings, Revit itself has some process to be able to list all the warnings, and clearly doesn't test every entity before doing so. So the list must be stored somehow/somewhere. Whilst detail would be very helpful, at this stage I am simply looking to return the number of warnings. As you are working in Revit R&D, can you advise if such a list is stored, and if there is any workaround to access it? Any snippet of information would be appreciated. Dale
Hi Dale,
I am sorry I was not more clear in my reply. Yes, of course, accumulated warnings (if any) are serialized in documents. However there is no publick access to it. It is what I meant by "no API". There is also no workaround, as the serialized information is not element-based. We understand the information could be of value to external programmers, but unless we explicitly add an API for it, external applications cannot get the list nor the number of failures.
We submitted a wish list item for this:
CF-2116 [API ability to retrieve Revit Warnings like Manage tab->Inquiry pane->Warnings].
Cheers,
Jeremy
Thanks for the reminder. Anything in 2017?
Dear Dale,
Thank you for your update.
I raised the priority of the wish list item CF-2116 [API ability to retrieve Revit Warnings like Manage tab--Inquiry pane--Warnings] for you and prompted the development team for an updated status report.
I hope this helps.
Cheers,
jeremy
Dear Dale,
Thank you for your patience.
The development team respond on the status of the wish list item CF-2116 [API ability to retrieve Revit Warnings like Manage tab--Inquiry pane--Warnings]:
We are aware of the request and will consider it for inclusion in a future release.
I also suggest having the developers file the request on idea station if not already there.
I hope this helps.
Cheers,
jeremy
Dear Dale,
Thank you again for your patience.
The development team responded further on our prompt for news on the wish list item CF-2116 [API ability to retrieve Revit Warnings like Manage tab--Inquiry pane--Warnings] and suggest:
Here is a proposed API:
in Autodesk::Revit::DB::Document:
/// <summary> /// Returns list of failure messages representing warnings accumulated in the document /// </summary> /// <remarks> /// Function returns list of failure messages identical to the list displayed in a warning dialog when command /// Manage tab > Inquiry pane > Warnings is issued through the UI /// </remarks> /// <returns> /// List of failure messages representing warnings accumulated in the document /// </returns> /// <since> /// 2018 /// </since> System::Collections::Generic::IList<Autodesk::Revit::DB::FailureMessage ^> ^GetWarnings();
In other words, in the next major release of the .NET Revit API, this would appear as a new method
System.Collections.Generic.IList<Autodesk.Revit.DB.FailureMessage> Autodesk.Revit.DB.Document.GetWarnings();
Will it suffice? Will you be able to test it?
That sounds pretty good to me.
What do you think?
Cheers,
Jeremy
Dear Jeremy,
I also looking for this feature. Yes this is good.
That sounds brilliant! Does "next version of API" mean Revit 2018? Thanks for following up.
Dear Dale, BholaDev and Kinjal,
Glad you like it and thank you for your appreciation.
There is no guarantee that such a version of Revit will ever be created, and I am therefore (as far as I know) not at liberty to even use that word or number.
But yes, it is intended to mean exactly what you think it is.
Thanks to all of you for your confirmation.
I added them all to the wish list item CF-2116 [API ability to retrieve Revit Warnings like Manage tab--Inquiry pane--Warnings].
Cheers,
Jeremy
Dear all,
Just to be absolutely clear:
The fact that this wish list item is 'under consideration' makes no promise whatsoever.
The development team underline that this work is currently not planned.
Thank you for your understanding!
Cheers,
Jeremy