<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get a list of all the Revit Warnings in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10400407#M61593</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;it is a pleasure. Feels good giving back to the community, which already provided me so much.&lt;/P&gt;&lt;P&gt;Yes I made some minor modifications to the code. Cleaned newline characters from the Descriptions. Played around with the AppendLine rows, merged into a single command. My goal was to return a string which is easier to parse in a spreadsheet.&lt;/P&gt;&lt;P&gt;Nothing interesting in my opinion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;string cleanedDescription = _acc.GetDescriptionText().Replace("\n", "").Replace("\r", "");
sb.AppendLine(string.Format("{0};{1};{2};{3}", _acc.GetSeverity(), _ClassName + "." + pInfo.Name, _acc.GetId().Guid, cleanedDescription));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jun 2021 06:48:15 GMT</pubDate>
    <dc:creator>schnierer.gabor</dc:creator>
    <dc:date>2021-06-18T06:48:15Z</dc:date>
    <item>
      <title>Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6733180#M61584</link>
      <description>&lt;P&gt;Is it possible to get a list of all the Revit warnings? The warnings that will appear in the Warning Inquiry window are warnings that appear in the model. However, I want the entire list. I want to find around 100 warning types and do not want 100 if statements, which would be required using the code I found:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void ControlledApplication_FailuresProcessing(object sender, Autodesk.Revit.DB.Events.FailuresProcessingEventArgs e)
        {
            FailuresAccessor accessor = e.GetFailuresAccessor();
            IList&amp;lt;FailureMessageAccessor&amp;gt; messages = accessor.GetFailureMessages();
            foreach (FailureMessageAccessor failure in messages)
            {
                FailureDefinitionId failId = failure.GetFailureDefinitionId();

                if (failId == BuiltInFailures.OverlapFailures.WallsOverlap)
                {
                    TaskDialog.Show("Deleting Failure", failure.GetDescriptionText());
                    accessor.DeleteWarning(failure);
                }
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, I would just like a complete list of Warning Error Messages, then I can add the ones I care about finding to a list and use List.Contains.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 11:39:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6733180#M61584</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-07T11:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6733712#M61585</link>
      <description>&lt;P&gt;Yes.&amp;nbsp;This is one important wish list item that we hope to&amp;nbsp;implement for the next major release of Revit. So no solution right now, but coming up anon. As always, no promises on any future stuff, but keeping my fingers crossed that our plans will come to full fruition.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 14:29:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6733712#M61585</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-12-07T14:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6733734#M61586</link>
      <description>&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it something you have a list, in some of the inner documentation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically want to highlight the key warnings then scan through the HTML output to find ones that are of interest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Graham&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 14:32:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6733734#M61586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-07T14:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6768286#M61587</link>
      <description>&lt;P&gt;Hi Graham,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the FailureDefinitionRegistry&amp;nbsp;to find the&amp;nbsp;failures , and using reflection you can distinguish between system defined and user-defined failures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
        public class ListFailures : IExternalCommand
        {
            StringBuilder sb = new StringBuilder();
            public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
            {

                UIDocument uiDoc = commandData.Application.ActiveUIDocument;
                Document document = uiDoc.Document;
                Autodesk.Revit.ApplicationServices.Application app = commandData.Application.Application;
                FailureDefinitionRegistry failureReg = Autodesk.Revit.ApplicationServices.Application.GetFailureDefinitionRegistry();

                Type _type = typeof(BuiltInFailures);
                Type[] _nested = _type.GetNestedTypes(System.Reflection.BindingFlags.Public);
                Dictionary&amp;lt;Guid, Type&amp;gt; _dict = new Dictionary&amp;lt;Guid, Type&amp;gt;();
                string _ClassName = string.Empty;
                foreach (Type nt in _nested)
                {
                    try
                    {
                        _ClassName = nt.FullName.Replace('+', '.'); 
                        sb.AppendLine(string.Format("#### {0} ####", _ClassName));
                        foreach (System.Reflection.PropertyInfo pInfo in nt.GetProperties())
                        {
                            System.Reflection.MethodInfo mInfo = pInfo.GetGetMethod();
                            FailureDefinitionId res = mInfo.Invoke(nt, null) as FailureDefinitionId;
                            if (res == null) continue;
                            if (_dict.ContainsKey(res.Guid)) continue;
                            _dict.Add(res.Guid, nt);
                            FailureDefinitionAccessor _acc = failureReg.FindFailureDefinition(res);
                            if (_acc == null) continue;
                            sb.AppendLine(string.Format("  * {0} &amp;lt;{1}&amp;gt; {2}", _acc.GetId().Guid, _acc.GetSeverity(), _ClassName));
                            sb.AppendLine(string.Format("          {0}", _acc.GetDescriptionText()));
                        }
                    }
                    catch
                    {
                    }
                }
                _ClassName = "user-defined";
                sb.AppendLine(string.Format("#### {0} ####", _ClassName));
                foreach (FailureDefinitionAccessor _acc in failureReg.ListAllFailureDefinitions())
                {
                    Type DefType = null;
                    _dict.TryGetValue(_acc.GetId().Guid,out DefType);
                    if (DefType != null) continue;  // failure already listed
                    sb.AppendLine(string.Format("  * {0} &amp;lt;{1}&amp;gt; {2}", _acc.GetId().Guid, _acc.GetSeverity(), _ClassName));
                    sb.AppendLine(string.Format("          {0}", _acc.GetDescriptionText()));
                }
                TaskDialog.Show("res", sb.ToString());
                return Result.Succeeded;

            }&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Dec 2016 21:54:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/6768286#M61587</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2016-12-23T21:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/8222040#M61588</link>
      <description>&lt;P&gt;Hi sir,&lt;/P&gt;&lt;P&gt;even mine dought is the same, m also looking for all the possible warnings that revit generates, but unfortunately m not so good in understanding the programming languages. So if you succeeded in finding the solution, will you please share the same with me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;M. Juned&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it something you have a list, in some of the inner documentation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically want to highlight the key warnings then scan through the HTML output to find ones that are of interest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Graham&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 09:51:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/8222040#M61588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-24T09:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/8222276#M61589</link>
      <description>&lt;P&gt;Use the Document.GetWarnings method:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://apidocs.co/apps/revit/2019/4774613d-600a-e1b5-b5aa-f1ee3b14394c.htm" target="_blank"&gt;https://apidocs.co/apps/revit/2019/4774613d-600a-e1b5-b5aa-f1ee3b14394c.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 12:00:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/8222276#M61589</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-08-24T12:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/8839678#M61590</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; I have been having trouble trying to match the returned FailureDefinitionId to an actual BuiltInFailure I could handle.&amp;nbsp; One small improvement is to also add the property name to your list.&lt;BR /&gt;&lt;BR /&gt;sb.AppendLine(string.Format(" * {0} &amp;lt;{1}&amp;gt; {2}", _acc.GetId().Guid, _acc.GetSeverity(), _ClassName + "." + pInfo.Name));&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 20:04:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/8839678#M61590</guid>
      <dc:creator>perry.swoboda</dc:creator>
      <dc:date>2019-06-07T20:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10399203#M61591</link>
      <description>&lt;P&gt;Using the awesome code from&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2083518"&gt;@FAIR59&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7186046"&gt;@perry.swoboda&lt;/a&gt;&amp;nbsp;here is a spreadsheet containing the BuiltInFailures for Revit 2022, their Severity, Classname, Guid and Description. M&lt;SPAN style="font-family: inherit;"&gt;ight come handy.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.google.com/spreadsheets/d/12glULCZL_yJkq7ko_vI-gEHu69dUIoiCRnmvdLpIoSU/edit?usp=sharing" target="_blank" rel="noopener"&gt;https://docs.google.com/spreadsheets/d/12glULCZL_yJkq7ko_vI-gEHu69dUIoiCRnmvdLpIoSU&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 19:23:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10399203#M61591</guid>
      <dc:creator>schnierer.gabor</dc:creator>
      <dc:date>2021-06-17T19:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10400248#M61592</link>
      <description>&lt;P&gt;Looks like just what the doctor ordered. Thank you very much for sharing that!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you use the code above as is or make any interesting modifications that might be worth while sharing as well, in case people would like to create their own versions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 05:14:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10400248#M61592</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-06-18T05:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10400407#M61593</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;it is a pleasure. Feels good giving back to the community, which already provided me so much.&lt;/P&gt;&lt;P&gt;Yes I made some minor modifications to the code. Cleaned newline characters from the Descriptions. Played around with the AppendLine rows, merged into a single command. My goal was to return a string which is easier to parse in a spreadsheet.&lt;/P&gt;&lt;P&gt;Nothing interesting in my opinion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;string cleanedDescription = _acc.GetDescriptionText().Replace("\n", "").Replace("\r", "");
sb.AppendLine(string.Format("{0};{1};{2};{3}", _acc.GetSeverity(), _ClassName + "." + pInfo.Name, _acc.GetId().Guid, cleanedDescription));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 06:48:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10400407#M61593</guid>
      <dc:creator>schnierer.gabor</dc:creator>
      <dc:date>2021-06-18T06:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all the Revit Warnings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10451733#M61594</link>
      <description>&lt;P&gt;Brilliant! Thank you again. Shared on the blog for posterity:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2021/07/installer-list-of-failures-adjacent-rooms-and-walls.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2021/07/installer-list-of-failures-adjacent-rooms-and-walls.html#3&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 05:49:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/get-a-list-of-all-the-revit-warnings/m-p/10451733#M61594</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-07-08T05:49:08Z</dc:date>
    </item>
  </channel>
</rss>

