This post is a shorthand version of a workshop that I was teaching recently at AEC Symposium and Hackathon that our kind folks at TT organized. I think it originally came to be when Jason Howden has asked me for some small improvements to Mandrill, and sent me an example of how his firm evaluates Revit warnings. That’s when I realized that there wasn’t really a good way of doing warning parsing, and that it should be looked at. That’s not exactly when I realized that Revit warnings are a steaming pile of garbage – I am pretty sure I knew about it before. There is virtually zero API exposure in that area, and even though the Revit team claims that its coming soon, it’s about 10 years too late. Anyways, here’s my take on it:
Now, to produce that complete “report”, it would be a really long explanation, so I will let you guys fill in the blanks and instead just cover the initial data processing of the HTML Warning file that Revit outputs, introduce all of the new nodes for Dynamo and show you what they do. Let’s start at the beginning and that is what are the warnings and how to get hold of them.
While working in Revit, we will occasionally manage to produce a warning. Those things are only slightly annoying, as they are usually pop up windows with some ambiguous message, and an OK button that allows us to dismiss them and just keep going. Even though it looks like they are gone, they are not. Revit stores them in the file, and that can have some consequences in the long run. Why? Because now, when you open your file these warnings need to be re-instantiated, and that can not only slow it down, but also potentially cause issues. I personally, prefer to keep the warnings at a minimum, and do some checkups throughout the life of a project. Some warnings are easily fixable, and some are a little more involved. That’s why I also like to rate my warnings on a scale of 1-3, with 1 being ignorable and 3 severe. Now, the issue with Revit API is that it doesn’t provide any access to these warnings programmatically. One has to use the user interface, and export them to an HTML file, but even that is not very well thought out, as some of the naming conventions in Revit clash with HTML encoding, causing some weird looking tables. Anyways, we won’t get into that. Let’s have a look at how we can access these warnings, once we have them exported to HTML.
First we need to parse the HTML file like so:
What this does it creates a sort of internal warning library that we can now operate on. We can do things like see what elements generated these warnings:
This returns a list of elements for each warning. It might be just a single item, or multiple items for warnings where two or more elements participated in its generation. One example is a Wall and Room Separation line overlapping. That will return two elements. These elements are not typical Dynamo elements as in they are generated from a HTML file, hence have no connection to your Revit file. Keep in mind that since you exported the HTML file, element Ids might change so trying to obtain actual Revit elements from Warning parsing might not always work out. However, if that was the goal you can do so like this:
I am not showing you results here on purpose. This HTML file was generated at work, and I don’t have the file with me at home. My results are all null, but you get the idea. Also, all of these nodes are part of the Archi-lab package.
Also, each warning element, depending on what generated it, might have different information about it stored. We can query it up like so:
As you can see some warnings have Design Option information, but some don’t. That’s because if a warning was generated by somehow misusing the design option functionality, it will have that Design Option info listed. Others were not, and for those we might only have things like Workset, Category or Type. Also keep in mind that for things like annotation, the Workset value returned is usually a View that such annotation resides in since they are view based and do not actually exist in Worksets.
Now, let’s talk about Warning rating. It’s a custom property that I added to Warnings to help me categorize them and create the nice chart that i posted above. The idea is that warning is rated from 1-3 based on a custom reference table. For this case I have used a CSV file that has two columns, warning message, and rating that I wish to assign to it. Why an external CSV file? Well, I realize that for me as an architect, I want to pay more attention to warnings related to Rooms, Walls etc. For a structural engineer or MEP guy, other types of warnings might have a greater meaning, so he can have his own CSV rating reference table. Here’s how to use that:
Here’s what the library needs to look like:
It’s important to make sure that the CSV file has headers and these two columns in it.
Once we assign the rating, we can sort and organize our warnings in all sorts of ways. Each warning also has a handful of properties like this:
We already discussed the Elements and Rating properties of a Warning. Let’s talk about the Message and Assigned Message. Message is the first column of our HTML report. It should give us some details about the cause of the warning as well a possible solution. These are usually good enough to identify different types of warning, since they will have the same message. However, there are cases when the same or similar warning will have a different message. One case is how Design Option related warnings get reported. They always include Design Option name, and since the same type of a warning can be generated by different elements in different design options its possible to have all of these warnings with different messages that basically say the same thing. In order to be able to group them together and get proper counts, I introduced the “Assigned Error Message” property. This property allows us to add a custom message to our warning so that we can do things like this:
What’s happening in this image is that we are taking all of the warnings, and searching for ones that have word “design” in their Message property. Then we assign a custom error message to all of the warnings, that says “Design Option Related Warning”. Once we do that, we re-join the lists back to their original order, but now, every Design Option related warning has the same message. That way we can just group them together as one type. The Python component here does this:
It takes the list of True/False boolean mask and searches out index values for all True items. That way we can use those to replace all elements in the original list.
I think that’s all I have for this new functionality. All of these nodes are available in the Archi-lab package, so please download them from the Package Manager. If you just want to give the whole thing a try using my sample warning files, and warning library, just give this a whirl:Warning Parsing Sample (1732 downloads)
This file is dependant on UI++, Archi-lab and Mandrill packages.
Please let me know if something is not clear, and I will try and help out. Cheers!
So it looks like people want all of the Revit warnings in a list. Here’s how:
Remember that like I have said in the comments, these are in some cases templates, so they won’t contain a warning message exactly like one you might encounter in your HTML report.
This is great Konrad. Thanks for sharing!
2 questions; is there a list somewhere of all the possible warnings Revit generates from which you created your CSV file, and are you creating the graph at the top of the post in Dynamo or just using Excel?
There is a way to obtain such list, but you don’t want it. Why? Because that list is just a template. Each warning is generated individually by passing it through that template. What that means is warnings list stored internally by Revit has blanks in it that are filled by actual elements when they are posting a warning. It makes it not very usable for this purpose. Also, its 900+ warnings long, and you will not see even 10th of that on a average project. If you still want to see it, i will save that thing out to Excel and send it to you. Even better, just make a new post on Dynamo Forum and i will reply there with Python code to get that.
The graph/report that is posted on top of the post is created using these new warning parsing nodes from Archi-lab and Mandrill package. Just download the sample file and you should be able to get the same thing. Of course you will need a different warning rating library as you are likely to get more/different warnings.
I’d be interested in an example of getting a list of all the possible warnings in Revit. Looking forward to your post on how to get them.
Please see the post above. I have made posted the code you are asking for.
I see what you’re getting at now. So, do you think the workflow would be to export the warnings, go through them in Excel to generate the ratings, and then use these as a CSV to run in Dynamo? I had hoped to be able to generate a single CSV file to apply to all projects in advance. It now looks like that the CSV file will/may grow over time. Good to know.
I used your Python code to write a macro in C#. It worked out great.
Here is the text file I got when running the macro in Revit 2017: https://app.box.com/s/1a1zig324s9zxp9o6izqru1dum1gtm26
Thanks for sharing!
I have also made an attempt to triage through various warnings and shared it at RTC2014.
At that time, there was no API to warnings, and instead of using dynamo, I have used Excel Pivot tables to triage the warnings from the HTM report.
If it helps anyone to understand what warnings’ criptic language means, attached is a PDF, and you can find dataset here:http://rtcevents.com/rtc2014au/materials/
Thanks for sharing! This is great stuff.
Thanks for sharing Helen!
Thanks for sharing this Konrad,
Great work with the Mandrill / D3.js stuff.
Quick question on the “create names that will be displayed when hover over a donut chart slice.” group. Are the ratings listed in different order between the first and second code blocks?
Looks like perhaps I made a mistake. Thanks for catching it!
Very nice job.
Next step to become the perfect Model manager would be to check warnings from a list of models (filepaths) _without actually opening the whole file… You would then get a fairly honest routine to check the health of models company wide.
I have been looking at nodes to get informations from a model without opening it, and all I could find was in the Bakery nodes: “Get Build Number from All RVTs in a Folder” for example. Do you think this can be achieved?
Well you will be able to fully automate this routine as soon as Revit 2018 comes out. Currently there is no way to extract warnings out of the file other than manually exporting them to an HTML report. I intend to update this method as soon as 2018 API is out.
Is there an easy way to find the most comment MEP revit warnings to create a csv file from?
Not that I know of. I am sorry.
Also i ran this dynamo script using your csv file but one of my own HTML warning files and i received the below errors on nodes. I’m relatively new to dynamo and could use some guidance as to what is going wrong?
Thank you for sharing, this is awesome.
I didn’t manage to structure my Warning Library.
I believe it is related to one of these reasons :
– the accents in french
– the format
If you could help me out I would appreciate it.
I am sorry, but unfortunately I don’t have means of recreating an error like that since I work in English and not french. I can’t help here. Please try the forum: https://forum.dynamobim.com and if someone with the same language settings can help that would be great. Cheers!
Thanks Konrad, amazing way of quickly sorting the warnings of our projects.
I have tested it on Revit 2016 with Dynamo 1.2.1 and it works perfectly. But I am trying to use it with Revit 2017.2 and my dynamo is crashing.
It is not a big issue because I can always use 2016, but is kind of an extra step opening both versions.
Do you know what might be the issue?
it runs ok without errors but I have the final node “Report Window ” as empty!
Did you try hitting the Launch Window button? I don’t think there will be any output on that last node if that’s what you are looking for.
Hi Konrad, this is great! thanks for sharing.
I am new to Dynamo and I having trouble with the warning parsing. All my chart style nodes show a warning: “the input types are not matching”. Do you know what I am doing wrong? Could it be my list of colors?
Never mind. It work! Thanks!
I couldn’t get the CSV file to work. Revit warnings contain comma’s in the warning text. And that corrupts the CSV. Using ” ” also did not work.
So I changed the *.CSV to *.TXT as input file for the WarningLibrary.WarningLibraryFromCsv node. And it worked. Very happy with this. Also thanks to Troy for his long list to use.
Ok. Too fast too soon.
I am still having troubles with the CSV file the way I wanted it to work. I am using a .TXT file now. Parse it. And add new Warning to the .TXT file if necessary. I also added a rough rating to Troy’s list. You can download the rough test files here https://goo.gl/wCruPr
I’m very interested in your approach and I’m developing something similar.
I was wondering that if you can share with me that model that gave three types of warnings severity as I want to try something like this.
Sorry, but I can’t share Revit models here, since they don’t belong to me. They belong to my previous employer. You can sure create your own warnings though. They are easy to come by.
Dynamo for 2019
Hi Konrad been using your warning parsing script since 2017 and had no problems in 2018.
In 2019 I get the error attached. I receive the warning attached in my List.GetItemAtIndex node. In addition to this anytime I try to print PDF I crash. Can you offer any insight as to why this might be happening I have been experiencing broken scripts in 2019 with dynamo version 2.0.2. I can forward the script if you would like best.
You posted that exact same comment before to my Portfolio page. I responded there too. I will need a minimal reproducible sample file. I can’t help if I can’t re-create this.
This looks awesome. I downloaded the script and had to fix some unresolved nodes. Probably because I had a newer version of Archi-Lab package installed. At any rate, I have a few issues. Some of my MEP warnings have System info and others have specific lengths (flex duct) that are getting ignored because they don’t match the CSV file list I made. I only get about 40% of the total warnings. I tried to remove the section for not matching list and it hangs up Dynamo. I did remove the section on Design Options as that doesn’t apply to me. With the rest intact, everything looks good but when I select the Launch Window button, Dynamo immediately crashes. See attached .docx file. I am not sure what is going on. Thanks!
I have never seen a crash like this. I am not sure what the solution for that is from top of my head. If you can do me a favor and post that to Mandrill’s GitHub page: https://github.com/BadMonkeysTeam/Mandrill under issues. I am a little short on time these days, but I will try and help out resolving this issue.
Issue posted here: https://github.com/BadMonkeysTeam/Mandrill/issues/57
Just checking in to see if you saw my above post and if you had a resolution. Also, I am getting unresolved nodes for the Color Picker node from Dynamo Core, I am assuming after installing Revit 2020 last week.
The Color Picker nodes can be found in the package called UI++. That package is no longer needed because the exact same component is now available via Color Palette from Dynamo. No package is needed. Please be aware that I don’t even have Revit 2020 installed so there was no testing done for any of the Dynamo components for that version.
I was not running this in 2020, I am running it in 2019. Thought it was a 2020 installation issue because the message said it had to do with the Dynamo Core.dll I did also uninstall and reinstall Dynamo last week so it looks like I forgot the UI++ package which I have now and replaced the nodes. Any ideas as to why Dynamo and Revit crash when I select “Launch Window”?
I do have an idea. It probably has to do with different versions of DLLs that Revit uses and Mandrill needs. There must be a conflict. Please move this conversation to GitHub. I will try and resolve this from there.
I am trying to use your sample dynamo script as a base point to modify it for our needs, but when I try to open the .dyn, I get an error about unresolved nodes, I have the UI++, Mantis, and Archi-Lab packages installed, but still get these errors.
Do you have any ideas on this? Dynamo is still a little strange to me, so maybe I am missing something obvious. . .
Attached is a screen grab of a portion of the file to illustrate, in case I need to be more specific.
Thanks in advance for any light you can shed on this!
Yeah, if they are showing up unresolved, then its possible the definition you downloaded is using an older version of the package. Just replace and re-wire all of the components with the ones you have. It should work.
Loving the script. Seen a few of these but love the simplicity of the results created from yours. can be interpreted by anyone.
I’m trying to get it to work my end though I’m having some trouble with the Archi-lab_Mandrill package. A few of the nodes in this package are missing the connections (see attached). I’ve tried a few versions of the same package but all the ones I’ve tried seem to produce the same results.
Curious if you’ve come across this and know a fix. or if you know of an alternative package our there that will give the same results.
Glad you like it!
update – the mandrill package required a newer version of Dynamo than the one I was using to make it appear correctly. Unfortunately other errors came up and the script didn’t run.
I’ve attached the graph if anyone more dynamo competent than me fancies looking into it further
Great! I don’t think I can do anything with the attached files. You didn’t attach any Revit sample files, so I don’t have warnings to run it against the warning library csv file you attached. You will have to post EVERYTHING that one might need to fully re-create the issue you are seeing. Otherwise I don’t think I can help.
This is likely caused by the fact that you are using pre-2.x version of Dynamo. Latest Mandrill was built against 2.0 if I remember correctly.
I’m currently trying to get your brilliant Dynamo script to execute but I keep on getting a lot of unresolved Dynamo node errors.
Would it be possible to upload the latest Dynamo script that uses all the latest packages?
I am trying to use this package. Everything seems to work right until I send a 0 into the Donut Chart. Have no warnings that rank 3 in the current file and the create report is giving me an error because of this.
I don’t know what you are doing. can you post an image? Sample files?
I actually figured it out. I was sending a null value into the nodes and was not getting an output.
My current issue is that this script takes forever to run. When I run it through dynamo it takes 15 minutes or so to run, when run through the dynamo player it takes hours to run.
Not sure what I am doing wrong but the mandrill package is really slowing down the script.
Mandrill is indeed relatively slow, but not to a tune of hours. Maybe its possible for it to take that long but it would require a massive Revit model. Is there anything you can share with us so that we can re-create the issue? I can’t really address this unless I can re-create.
Is there a way to share files not on here, mine exceed the 2MB limit.
Thank You for your work. Is really helpfull
I’m trying to generate a list of all the warnings in spanish. I’m kind of working arround dynamo, but with code and macros I’m usseless.
Is there some kind of tutorial to use the code?
I don’t think the process for extracting the warnings is any different than the one described here. I think that if you change Revit’s language to Spanish, all of the warning messages would be in that language. I might be wrong on that since I never tried it in a different language, but give that a try.
My problem is that I don´t know how to apply the allRevitWarnings.py file.
I’m working ok with the nodes and modifying the .dyn file to my workflow.
The problem for my is that I need a list of all the warnings in the Spanish Revit version to ad it to one excel sheet.
Its a code that would go into the Python node. You can create a new Dynamo script, then add a python component, copy paste the above code into it. That should allow you to get all of the warning messages that exist in Revit.
Hi Konrad! With your help it worked OK
I’m uploading the .doc file, maybe is helpful for other users
I am trying the example dynamo with the sample files but a get the following Issue due to Argument type by Chart node. (see image)
I don´t know if I need some Library or package…
I am trying it with Revit 2020 (126.96.36.1997), integrated Dynamo (Dynamo Core 188.8.131.5200 and Dynamo Revit (184.108.40.20633). Packages installed (see png)
I have changed all the nodes with latest version from Mandrill.
Thank you very much for your time.
You are getting that error because input for Headers is missing. The node indicates that by being a slightly lighter grey color than other nodes. Please fill that out and try again.
Looking for the grimshaw package to make it work any solution?
That package is called archi-lab.net now.