<?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: ExternalEvent.Raise() don't execute immediately mothod &amp;quot;Excute&amp;quot; in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9170303#M44676</link>
    <description>&lt;P&gt;If it works reliably for you under all circumstances, then not, obviously.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know, and I can add a note to that old post pointing out that there is a better way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 17:57:46 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2019-11-27T17:57:46Z</dc:date>
    <item>
      <title>ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8548613#M44667</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;
&lt;P&gt;I have a problem, I call&amp;nbsp;ExternalEvent.Raise() but it doesn't execute&amp;nbsp;immediately method "Execute" in&amp;nbsp;ExternalEventHandler. In fact,&amp;nbsp;RelayCommand complete, then "Execute" in&amp;nbsp;ExternalEventHandler&amp;nbsp;execute. Is there any way call Raise () and then immediately execute method "Execute"? Thank you.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="A.PNG" style="width: 996px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/595163i3813E8AAA0E5176C/image-size/large?v=v2&amp;amp;px=999" role="button" title="A.PNG" alt="A.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="B.PNG" style="width: 536px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/595164i34313CD1FAB82FC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="B.PNG" alt="B.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="C.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/595165i1B51E73C14E61136/image-size/large?v=v2&amp;amp;px=999" role="button" title="C.PNG" alt="C.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 06:46:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8548613#M44667</guid>
      <dc:creator>NhuTruong_BeyCons</dc:creator>
      <dc:date>2019-01-25T06:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8550691#M44668</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please have a look on this link, some useful information and things to consider while useing external events.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2013/12/triggering-immediate-external-event-execute.html" target="_blank" rel="noopener"&gt;https://thebuildingcoder.typepad.com/blog/2013/12/triggering-immediate-external-event-execute.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 21:16:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8550691#M44668</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2019-01-25T21:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557177#M44669</link>
      <description>&lt;P&gt;Thank you for your help. I followed the following tutorial link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2016/03/implementing-the-trackchangescloud-external-event.html" target="_blank" rel="noopener"&gt;https://thebuildingcoder.typepad.com/blog/2016/03/implementing-the-trackchangescloud-external-event.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;, but the result of "Execute" still did not execute after Raise (). Please, helps me.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="A.png" style="width: 669px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/596488i59AA6BA8AD86EBE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="A.png" alt="A.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 07:45:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557177#M44669</guid>
      <dc:creator>NhuTruong_BeyCons</dc:creator>
      <dc:date>2019-01-29T07:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557258#M44670</link>
      <description>&lt;P&gt;You ask:&amp;nbsp;&lt;SPAN&gt;Is there any way call Raise and then immediately execute method Execute?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would say the answer is No.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 08:38:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557258#M44670</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-01-29T08:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557286#M44671</link>
      <description>&lt;P&gt;I checked with a simple example like the image, the result is count = 0, not count = 1&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AutoJoin.png" style="width: 748px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/596505i57B7D34D80AE9046/image-size/large?v=v2&amp;amp;px=999" role="button" title="AutoJoin.png" alt="AutoJoin.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 08:52:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557286#M44671</guid>
      <dc:creator>NhuTruong_BeyCons</dc:creator>
      <dc:date>2019-01-29T08:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557323#M44672</link>
      <description>&lt;P&gt;Thank&amp;nbsp;&lt;SPAN&gt;Jeremy,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So, do you have a way to use transactions outside of IExternalCommand, which works in order?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 09:05:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/8557323#M44672</guid>
      <dc:creator>NhuTruong_BeyCons</dc:creator>
      <dc:date>2019-01-29T09:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9168227#M44673</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4343254"&gt;@NhuTruong_BeyCons&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how I solved it:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When the first command to open the window is executed, I save a reference to the UIApplication in a static class from the commandData&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;And every time when I want to raise the event&amp;nbsp;instead of using the event.Raise() I use&amp;nbsp;eventHandler.Execute and I pass the UIApplication from the static class&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;eventHandler.Execute(StaticClass.UIApplication)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and it works successfully.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;do you think this is a safe way to go?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 19:36:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9168227#M44673</guid>
      <dc:creator>SamBerk</dc:creator>
      <dc:date>2019-11-26T19:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9169124#M44674</link>
      <description>&lt;P&gt;That sounds fine to me. Congratulations on solving it!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 07:55:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9169124#M44674</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-27T07:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9170056#M44675</link>
      <description>&lt;P&gt;So that means that I don't need this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2013/12/triggering-immediate-external-event-execute.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2013/12/triggering-immediate-external-event-execute.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;complicated solution?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9170056#M44675</guid>
      <dc:creator>SamBerk</dc:creator>
      <dc:date>2019-11-27T16:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9170303#M44676</link>
      <description>&lt;P&gt;If it works reliably for you under all circumstances, then not, obviously.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know, and I can add a note to that old post pointing out that there is a better way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 17:57:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9170303#M44676</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-27T17:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9174018#M44677</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4343254"&gt;@NhuTruong_BeyCons&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized that this is not a complete solution, because it only works with read-only events, but if you want to use a transaction in the event it will throw an exception that "Starting a transaction from an external application running outside of API context is not allowed", it only works with event.Raise().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in fact, if you wanna do a read-only event, you don't need an&amp;nbsp;IExternalEventHandler&amp;nbsp;and call eventHandler.Execute() at all, you just need to &lt;SPAN&gt;save a reference to the UIApplication in a static field from the commandData&amp;nbsp;when the first command to open the window is executed, and then you can use the UIApplication wherever in your code you want to read data from Revit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 16:26:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9174018#M44677</guid>
      <dc:creator>SamBerk</dc:creator>
      <dc:date>2019-11-29T16:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9174192#M44678</link>
      <description>&lt;P&gt;You can also shoot yourself in the foot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Making calls to the Revit API outside of a valid Revit API context can corrupt your data and crash Revit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You &lt;U&gt;cannot&lt;/U&gt;&amp;nbsp;&lt;SPAN&gt;"use the UIApplication wherever in your code you want to read data from Revit".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can only make calls from within a valid Revit API context:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2015/08/revit-api-context-and-form-creation-errors.html#2" target="_blank" rel="noopener"&gt;http://thebuildingcoder.typepad.com/blog/2015/08/revit-api-context-and-form-creation-errors.html#2&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 19:08:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/9174192#M44678</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-29T19:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: ExternalEvent.Raise() don't execute immediately mothod "Excute"</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/11658763#M44679</link>
      <description>&lt;P&gt;Hi,I want to ask if you have solved this problem now?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 09:56:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/externalevent-raise-don-t-execute-immediately-mothod-quot-excute/m-p/11658763#M44679</guid>
      <dc:creator>434977268</dc:creator>
      <dc:date>2023-01-05T09:56:48Z</dc:date>
    </item>
  </channel>
</rss>

