<?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: How to close the Editing Request Placed window programmatically in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7212653#M57433</link>
    <description>&lt;P&gt;Thanks Jeremy.&lt;BR /&gt;I'll have to use the Windows API to simulate a user clicking a button.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2017 13:01:26 GMT</pubDate>
    <dc:creator>talalaevd</dc:creator>
    <dc:date>2017-07-07T13:01:26Z</dc:date>
    <item>
      <title>How to close the Editing Request Placed window programmatically</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7181733#M57430</link>
      <description>&lt;P&gt;I implemented the error handling as follows&lt;/P&gt;
&lt;PRE&gt;public class MyWorksetElementPreprocessor : IFailuresPreprocessor
        {
            public FailureProcessingResult PreprocessFailures(FailuresAccessor failuresAccessor)
            {
                IList&amp;lt;FailureMessageAccessor&amp;gt; failList = new List&amp;lt;FailureMessageAccessor&amp;gt;();
                failList = failuresAccessor.GetFailureMessages();
                foreach (FailureMessageAccessor failure in failList)
                {
                    FailureDefinitionId failID = failure.GetFailureDefinitionId();
                    if (failID == BuiltInFailures.EditingFailures.OwnedByOther)
                    {
                        failuresAccessor.ResolveFailure(failure);
                        return FailureProcessingResult.ProceedWithRollBack;
                    }
                }
                return FailureProcessingResult.Continue;
            }
        }&lt;/PRE&gt;
&lt;PRE&gt;private static Transaction MakeTransaction(Document doc, string name, bool useFailureHandlingOpts)
        {
            Transaction t = new Transaction(doc, name);
            if (useFailureHandlingOpts)
            {
                FailureHandlingOptions opts = t.GetFailureHandlingOptions();
                opts.SetClearAfterRollback(true);
                opts.SetFailuresPreprocessor(new MyWorksetElementPreprocessor());
                t.SetFailureHandlingOptions(opts);
            }
            return t;
        }&lt;/PRE&gt;
&lt;PRE&gt;public bool UpdateProjectEdit(Document _doc, TreeView _treeview, string _name)
        {
            bool result = false;
            TreeNode elms = _treeview.SelectedNode;
            Element elm_rename = (Element)elms.Tag;
            TransactionStatus t_status;
            using (Transaction t = MakeTransaction(_doc, "Rename element " + elm_rename.Name, true))
            {
                t.Start();
                elm_rename.Name = _name;
                t_status = t.Commit();
            }
            if (t_status != TransactionStatus.RolledBack)
            {
                result = true;
            }
            return result;
        }&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;But when processing a borrowed item error, this window appears&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="2017-06-27_14-26-22.jpg" style="width: 363px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/371816i706D3F84481A47CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2017-06-27_14-26-22.jpg" alt="2017-06-27_14-26-22.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I do not know yet how to close this window automatically.&amp;nbsp;Does anyone have any advice?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 11:32:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7181733#M57430</guid>
      <dc:creator>talalaevd</dc:creator>
      <dc:date>2017-06-27T11:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to close the Editing Request Placed window programmatically</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7182386#M57431</link>
      <description>&lt;P&gt;I tried to use &lt;STRONG&gt;EventHandler &amp;lt;DialogBoxShowingEventArgs&amp;gt;&lt;/STRONG&gt; but the specified window is not intercepted in any way. In the log there is an entry about the event &lt;STRONG&gt;Jrn.PushButton "Modal, Hosted editing request, Dialog_Revit_CheckEditabilityGrants", "Close, IDOK"&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;What can &lt;STRONG&gt;Dialog_Revit_CheckEditabilityGrants&lt;/STRONG&gt; mean and where can I use it?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 14:29:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7182386#M57431</guid>
      <dc:creator>talalaevd</dc:creator>
      <dc:date>2017-06-27T14:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to close the Editing Request Placed window programmatically</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7212403#M57432</link>
      <description>&lt;P&gt;Dear Дмитрий,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All that I can say about handling dialogues and failures is covered by The Building Coder topic group 5.32:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.32" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.32&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all else fails, you can always use the Windows API to simulate mouse clicks and all other required user input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2009/10/dismiss-dialogue-using-windows-api.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2009/10/dismiss-dialogue-using-windows-api.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, with one single button to click, that should be fairly easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also submit a request to the Revit Idea Station for future versions of the Revit API to support this action directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:50:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7212403#M57432</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-07-07T11:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to close the Editing Request Placed window programmatically</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7212653#M57433</link>
      <description>&lt;P&gt;Thanks Jeremy.&lt;BR /&gt;I'll have to use the Windows API to simulate a user clicking a button.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 13:01:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-close-the-editing-request-placed-window-programmatically/m-p/7212653#M57433</guid>
      <dc:creator>talalaevd</dc:creator>
      <dc:date>2017-07-07T13:01:26Z</dc:date>
    </item>
  </channel>
</rss>

