Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Warning Information

18 REPLIES 18
SOLVED
Reply
Message 1 of 19
Dale.Bartlett
965 Views, 18 Replies

Warning Information

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




______________
Yes, I'm Satoshi.
18 REPLIES 18
Message 2 of 19
arnostlobel
in reply to: Dale.Bartlett

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

Arnošt Löbel
Message 3 of 19
Dale.Bartlett
in reply to: arnostlobel

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.
Message 4 of 19
arnostlobel
in reply to: Dale.Bartlett

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
in reply to: arnostlobel

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.
Message 6 of 19

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
in reply to: jeremytammik

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


Message 8 of 19
Dale.Bartlett
in reply to: kinjal

Thanks for the reminder. Anything in 2017?




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

Anything???



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

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

Message 11 of 19

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

Message 12 of 19

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

Message 13 of 19
SinghManish
in reply to: jeremytammik

Dear Jeremy,

 

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

Manish Singh
Message 14 of 19
Dale.Bartlett
in reply to: SinghManish

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




______________
Yes, I'm Satoshi.
Message 15 of 19
kinjal
in reply to: Dale.Bartlett

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


Message 16 of 19

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

Message 17 of 19
kinjal
in reply to: jeremytammik

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


Message 18 of 19

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

Message 19 of 19

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.
Erik Eriksson
White

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community