Retrieve warnings in order from the warnings dialog

Retrieve warnings in order from the warnings dialog

Anonymous
Not applicable
942 Views
5 Replies
Message 1 of 6

Retrieve warnings in order from the warnings dialog

Anonymous
Not applicable

I want to retrieve all warnings in the document in the same order as they are represented in the warnings dialog.

My macro is going to let the user type in the warnings number from the dialog and isolate those elements etc.

Is there any logic to the order of the warnings in the warning dialog that I'm not seeing?

0 Likes
943 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

I am not aware of anything related but the GetWarnings method:

 

https://apidocs.co/apps/revit/2019/4774613d-600a-e1b5-b5aa-f1ee3b14394c.htm

 

How about using that to retrieve the data and then sorting it yourself as you please?

 

Cheers,

 

Jeremy

 



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

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks for your quick reply Jeremy. Yes, GetWarnings() works fine for retrieving the data.

 

But since the revit users are familiar with the warnings dialog interface I thought it would be simple to let them just type in the Warning Number that's presented in the dialog, rather than to create my own interface for all active warnings. I'd like to retrieve a string like "Warning 39: ..." to work with. 

 

I tried to compare the order of my warnings with the order of all possible warnings from the GetFailureDefinitionRegistry() .ListAllDefinitions() but there seems to be no logical order in either of the lists.

0 Likes
Message 4 of 6

jeremytammik
Autodesk
Autodesk

Thank you for your appreciation. My pleasure entirely. Does the info returned by GetWarnings not include the warning number? If so, you could extract that and sort it yourself as you please.

 



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

0 Likes
Message 5 of 6

Anonymous
Not applicable

No, I have not yet found a way to retrieve the number of each warning. Not through GetWarnings.

0 Likes
Message 6 of 6

FAIR59
Advisor
Advisor

The code pre-Revit2019, to get all the warnings, gets the list in the correct order.

see: https://forums.autodesk.com/t5/revit-api-forum/extract-past-warnings-from-rvt-file-before-2018/m-p/7...

0 Likes