<?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: Check if can delete a view in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9100364#M39163</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;AFAIK I think it is not possible something similar was raised here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/iupdater-needs-ondeleting-trigger-changetype/td-p/7929378" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/iupdater-needs-ondeleting-trigger-changetype/td-p/7929378&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Indeed your idea is great and valid, especially there is no Undo feature if a view is deleted. if a view is deleted, it is gone forever, unless you did not save. it would be great if we can extract back the deleted view from the original file before saving via API and UI as well.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Oct 2019 09:08:43 GMT</pubDate>
    <dc:creator>Moustafa_K</dc:creator>
    <dc:date>2019-10-22T09:08:43Z</dc:date>
    <item>
      <title>Check if can delete a view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9098378#M39160</link>
      <description>&lt;P&gt;I want to see if a warning is going to be presented to user to say hey, dont delete that view as it will delete view x,y,z as well. I used something similar to this to prevent walls being created with errors, however is there something more staightforward or do i need to get some boolean flag return from a call to the below. it doesnt seem to work as i have to try to delete an object before it rolls back the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private static void SendTransactionToSwallower(Transaction transSwallow)&lt;BR /&gt;{&lt;BR /&gt;FailureHandlingOptions failOpt = transSwallow.GetFailureHandlingOptions();&lt;BR /&gt;failOpt.SetFailuresPreprocessor(new WarningRollback());&lt;BR /&gt;failOpt.SetClearAfterRollback(true);&lt;BR /&gt;transSwallow.SetFailureHandlingOptions(failOpt);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;class WarningRollback : IFailuresPreprocessor&lt;BR /&gt;{&lt;BR /&gt;FailureProcessingResult IFailuresPreprocessor.PreprocessFailures(FailuresAccessor a)&lt;BR /&gt;{&lt;BR /&gt;IList&amp;lt;FailureMessageAccessor&amp;gt; failures = a.GetFailureMessages();&lt;/P&gt;&lt;P&gt;foreach (FailureMessageAccessor f in failures)&lt;BR /&gt;{&lt;BR /&gt;FailureSeverity fseverity = a.GetSeverity();&lt;/P&gt;&lt;P&gt;a.ResolveFailure(f);&lt;BR /&gt;return FailureProcessingResult.ProceedWithRollBack;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;return FailureProcessingResult.Continue;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 12:08:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9098378#M39160</guid>
      <dc:creator>FrankHolidaytoiling</dc:creator>
      <dc:date>2019-10-21T12:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Check if can delete a view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9098452#M39161</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3635182"&gt;@FrankHolidaytoiling&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think Postfailure is what you are looking for&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2015/5d25d459-a1b0-eef4-4766-b00bd1f5ba79.htm" target="_blank" rel="noopener"&gt;https://www.revitapidocs.com/2015/5d25d459-a1b0-eef4-4766-b00bd1f5ba79.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 12:41:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9098452#M39161</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2019-10-21T12:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Check if can delete a view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9099554#M39162</link>
      <description>&lt;P&gt;Hi Kumar,&lt;/P&gt;&lt;P&gt;How can I use this code to find if a warning is generated after I delete say a view with one or more callouts. So I can set a flag to say cant delete view or can delete view in the calling code?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 20:46:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9099554#M39162</guid>
      <dc:creator>FrankHolidaytoiling</dc:creator>
      <dc:date>2019-10-21T20:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Check if can delete a view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9100364#M39163</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;AFAIK I think it is not possible something similar was raised here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/iupdater-needs-ondeleting-trigger-changetype/td-p/7929378" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/iupdater-needs-ondeleting-trigger-changetype/td-p/7929378&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Indeed your idea is great and valid, especially there is no Undo feature if a view is deleted. if a view is deleted, it is gone forever, unless you did not save. it would be great if we can extract back the deleted view from the original file before saving via API and UI as well.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 09:08:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9100364#M39163</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2019-10-22T09:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Check if can delete a view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9192296#M39164</link>
      <description>Problem solved?</description>
      <pubDate>Tue, 10 Dec 2019 01:57:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9192296#M39164</guid>
      <dc:creator>段小文</dc:creator>
      <dc:date>2019-12-10T01:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Check if can delete a view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9521678#M39165</link>
      <description>&lt;P&gt;Is there a failure that is reported if on deleting a view another view will be deleted because it is not referenced in any other views?&lt;/P&gt;&lt;P&gt;FailureDefinitionId id = f.GetFailureDefinitionId();&lt;BR /&gt;if (BuiltInFailures.SomeFailureClasses.ASpecificFailureType == id)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 07:53:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-if-can-delete-a-view/m-p/9521678#M39165</guid>
      <dc:creator>FrankHolidaytoiling</dc:creator>
      <dc:date>2020-05-17T07:53:40Z</dc:date>
    </item>
  </channel>
</rss>

