Warning Information

Warning Information

Dale.Bartlett
Collaborator Collaborator
1,500 Views
18 Replies
Message 1 of 19

Warning Information

Dale.Bartlett
Collaborator
Collaborator

All, Is it possible via the API to return the total number of warnings in a project? Thanks, Dale




______________
Yes, I'm Satoshi.
0 Likes
Accepted solutions (1)
1,501 Views
18 Replies
Replies (18)
Message 2 of 19

arnostlobel
Alumni
Alumni

Unfortunatelly, Revit does not have such an API. Users can get failures that occur during active transactions only. 

Arnošt Löbel
0 Likes
Message 3 of 19

Dale.Bartlett
Collaborator
Collaborator

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




______________
Yes, I'm Satoshi.
0 Likes
Message 4 of 19

arnostlobel
Alumni
Alumni
Accepted solution

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.

Arnošt Löbel
Message 5 of 19

Dale.Bartlett
Collaborator
Collaborator
Thanks Arnost, I understood that was the case, however your reply has been very helpful. This would be a good list to expose. It would enable a basic start-up QA process to advise users to clean up the model. We know it should be done daily, but a check and notification is a good prompt. Regards, Dale



______________
Yes, I'm Satoshi.
0 Likes
Message 6 of 19

jeremytammik
Autodesk
Autodesk

We submitted a wish list item for this:

 

CF-2116 [API ability to retrieve Revit Warnings like Manage tab->Inquiry pane->Warnings].

 

Cheers, 

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 19

kinjal
Enthusiast
Enthusiast
Any updates regarding this wish list item?
Kinjal Desai
Fullstack developer @ Dwaravati
Delivering high quality programmatic boosts for your already beautiful Revit


0 Likes
Message 8 of 19

Dale.Bartlett
Collaborator
Collaborator

Thanks for the reminder. Anything in 2017?




______________
Yes, I'm Satoshi.
0 Likes
Message 9 of 19

Dale.Bartlett
Collaborator
Collaborator
Anything???



______________
Yes, I'm Satoshi.
0 Likes
Message 10 of 19

jeremytammik
Autodesk
Autodesk

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 11 of 19

jeremytammik
Autodesk
Autodesk

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 12 of 19

jeremytammik
Autodesk
Autodesk

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 13 of 19

Anonymous
Not applicable

Dear Jeremy,

 

I also looking for this feature. Yes this is good.

0 Likes
Message 14 of 19

Dale.Bartlett
Collaborator
Collaborator

That sounds brilliant! Does "next version of API" mean Revit 2018? Thanks for following up.




______________
Yes, I'm Satoshi.
0 Likes
Message 15 of 19

kinjal
Enthusiast
Enthusiast

Great! This will surely suffice.

 

Awaiting the release (can it be expected before Revit 2018?)

Kinjal Desai
Fullstack developer @ Dwaravati
Delivering high quality programmatic boosts for your already beautiful Revit


0 Likes
Message 16 of 19

jeremytammik
Autodesk
Autodesk

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 17 of 19

kinjal
Enthusiast
Enthusiast
🙂
Kinjal Desai
Fullstack developer @ Dwaravati
Delivering high quality programmatic boosts for your already beautiful Revit


0 Likes
Message 18 of 19

jeremytammik
Autodesk
Autodesk

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 19 of 19

Anonymous
Not applicable
There is a way to do it right now.
It is suggested by Arnost Lobel in a post somewhere.
Basically you programmatically invoke the Warnings command in the revit ui and revit will post all warnings that exists in the document. If you write a handler that handles those warnings, you can count them, or what every you like.
0 Likes