<?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 Suppress FailureMessage on opening of a model in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/suppress-failuremessage-on-opening-of-a-model/m-p/12799143#M5070</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is there any method where I can suppress FailureMessages on opening of a model?&lt;/P&gt;&lt;P&gt;I realise there is a method during a transation where the&amp;nbsp;FailureMessage can be Deleted eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim failMessages As IList(Of FailureMessageAccessor) = failuresAccessor.GetFailureMessages()
For Each fma As FailureMessageAccessor In failMessages
   failure
    If fma.GetFailureDefinitionId = BuiltInFailures.RoomFailures.RoomNotEnclosed Then
        failuresAccessor.DeleteWarning(fma)
    End If
Next&lt;/LI-CODE&gt;&lt;P&gt;However from what I undestand this can only be called during a transation eg:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Using Transaction As New Transaction(e.Document, "Handle Document Opened Failures")
    Dim failOpt As FailureHandlingOptions = Transaction.GetFailureHandlingOptions
    failOpt.SetFailuresPreprocessor(New SuppressRoomFailures)
    Transaction.SetFailureHandlingOptions(failOpt)
    Transaction.Start()
    Transaction.Commit()
End Using&lt;/LI-CODE&gt;&lt;P&gt;Is there any way the warning can be suppressed without needing a transation e.g. from the&amp;nbsp;DocumentOpened event?&lt;/P&gt;&lt;P&gt;I also need the same from space not enclosed but I can't seem to find SpaceNotEnclosed.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rockit_for_Revit_0-1716780459392.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1367610i7FBD38F51A212B32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rockit_for_Revit_0-1716780459392.png" alt="Rockit_for_Revit_0-1716780459392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2024 03:28:27 GMT</pubDate>
    <dc:creator>Rockit_for_Revit</dc:creator>
    <dc:date>2024-05-27T03:28:27Z</dc:date>
    <item>
      <title>Suppress FailureMessage on opening of a model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/suppress-failuremessage-on-opening-of-a-model/m-p/12799143#M5070</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is there any method where I can suppress FailureMessages on opening of a model?&lt;/P&gt;&lt;P&gt;I realise there is a method during a transation where the&amp;nbsp;FailureMessage can be Deleted eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim failMessages As IList(Of FailureMessageAccessor) = failuresAccessor.GetFailureMessages()
For Each fma As FailureMessageAccessor In failMessages
   failure
    If fma.GetFailureDefinitionId = BuiltInFailures.RoomFailures.RoomNotEnclosed Then
        failuresAccessor.DeleteWarning(fma)
    End If
Next&lt;/LI-CODE&gt;&lt;P&gt;However from what I undestand this can only be called during a transation eg:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Using Transaction As New Transaction(e.Document, "Handle Document Opened Failures")
    Dim failOpt As FailureHandlingOptions = Transaction.GetFailureHandlingOptions
    failOpt.SetFailuresPreprocessor(New SuppressRoomFailures)
    Transaction.SetFailureHandlingOptions(failOpt)
    Transaction.Start()
    Transaction.Commit()
End Using&lt;/LI-CODE&gt;&lt;P&gt;Is there any way the warning can be suppressed without needing a transation e.g. from the&amp;nbsp;DocumentOpened event?&lt;/P&gt;&lt;P&gt;I also need the same from space not enclosed but I can't seem to find SpaceNotEnclosed.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rockit_for_Revit_0-1716780459392.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1367610i7FBD38F51A212B32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rockit_for_Revit_0-1716780459392.png" alt="Rockit_for_Revit_0-1716780459392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 03:28:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/suppress-failuremessage-on-opening-of-a-model/m-p/12799143#M5070</guid>
      <dc:creator>Rockit_for_Revit</dc:creator>
      <dc:date>2024-05-27T03:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress FailureMessage on opening of a model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/suppress-failuremessage-on-opening-of-a-model/m-p/12799472#M5071</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4956296"&gt;@Rockit_for_Revit&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If we have a&amp;nbsp;&lt;STRONG&gt;Warning&amp;nbsp;&lt;/STRONG&gt;it can be easily resolved. But For error, we don't have a resolution. We need to Subscribe &lt;A href="https://www.revitapidocs.com/2021.1/388605d5-1096-6017-6b3b-f818a36eeffc.htm" target="_blank" rel="noopener"&gt;FailuresProcessing Event&lt;/A&gt;&amp;nbsp;in IExternalApplication class and implement your failure handling inside that event. This will suppress warnings on file opening. Kindly check the below code for additional reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reference Code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class RvtApp : IExternalApplication
    {
        public Result OnShutdown(UIControlledApplication application)
        {
            return Result.Succeeded;
        }

        public Result OnStartup(UIControlledApplication application)
        {
            application.ControlledApplication.FailuresProcessing += ControlledApplication_FailuresProcessing;

            return Result.Succeeded;
        }

        private void ControlledApplication_FailuresProcessing(object sender, Autodesk.Revit.DB.Events.FailuresProcessingEventArgs e)
        {
            FailuresAccessor fa = e.GetFailuresAccessor();
            IList&amp;lt;FailureMessageAccessor&amp;gt; failList = new List&amp;lt;FailureMessageAccessor&amp;gt;();
            failList = fa.GetFailureMessages(); // Inside event handler, get all warnings
            foreach (FailureMessageAccessor failure in failList)
            {
                if (fa.GetSeverity()==FailureSeverity.Warning)
                {
                    fa.DeleteWarning(failure);
                }
            }

            e.SetProcessingResult(FailureProcessingResult.Continue);
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;The source code is on C# , Please convert it to VB.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Additional Reference on Failure Handling:&amp;nbsp;&lt;A href="https://spiderinnet.typepad.com/blog/2011/02/implement-a-revit-failuresprocessing-event-handler-with-c.html" target="_blank" rel="noopener"&gt;https://spiderinnet.typepad.com/blog/2011/02/implement-a-revit-failuresprocessing-event-handler-with-c.html&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this will Helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 08:16:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/suppress-failuremessage-on-opening-of-a-model/m-p/12799472#M5071</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-05-27T08:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress FailureMessage on opening of a model</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/suppress-failuremessage-on-opening-of-a-model/m-p/12799523#M5072</link>
      <description>&lt;P&gt;Perfect thank you&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 08:27:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/suppress-failuremessage-on-opening-of-a-model/m-p/12799523#M5072</guid>
      <dc:creator>Rockit_for_Revit</dc:creator>
      <dc:date>2024-05-27T08:27:08Z</dc:date>
    </item>
  </channel>
</rss>

