<?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: Revit addin communicating with other process in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9276488#M37063</link>
    <description>&lt;P&gt;Yes. Thank you for the relevant and interesting question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The recommended approach is to implement and use an external event for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The external event SDK sample illustrates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;SDK/Samples/ModelessDialog/ModelessForm_ExternalEvent/&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many related discussions and solutions are listed by The Building Coder on&amp;nbsp;External Events for Modeless Access and Driving Revit from Outside:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check out some more recent discussions on using IPC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/04/set-floor-level-and-use-ipc-for-disentanglement.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/04/set-floor-level-and-use-ipc-for-disentanglement.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/09/scaling-an-add-in-for-a-4k-high-resolution-screen.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/09/scaling-an-add-in-for-a-4k-high-resolution-screen.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/09/ui-top-forms-buttons-web-etc.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/09/ui-top-forms-buttons-web-etc.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/11/integrating-the-helix-3d-viewer-with-a-wpf-add-in.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/11/integrating-the-helix-3d-viewer-with-a-wpf-add-in.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2020 11:00:55 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2020-01-27T11:00:55Z</dc:date>
    <item>
      <title>Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9275981#M37062</link>
      <description>&lt;P&gt;Hello, I need to write a Revit addin(the external command) which listens messages from other process (not from revit itself).&lt;BR /&gt;In other word, the revit addin would be the server, another process would be a client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use async pipe to communicate with other process but revit addin couldn't listen any messages. I think it's because of my server side pipe in revit closed as execute() returns value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is below.&lt;BR /&gt;Is there any way to keep the server pipe still alive even after the addin's execute() finished?&lt;BR /&gt;I think I should create a thread in the execute() to resolve this issue. Is this approach feasible?&lt;BR /&gt;If there are some example codes, I really appreciate.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 06:03:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9275981#M37062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-27T06:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9276488#M37063</link>
      <description>&lt;P&gt;Yes. Thank you for the relevant and interesting question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The recommended approach is to implement and use an external event for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The external event SDK sample illustrates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;SDK/Samples/ModelessDialog/ModelessForm_ExternalEvent/&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many related discussions and solutions are listed by The Building Coder on&amp;nbsp;External Events for Modeless Access and Driving Revit from Outside:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check out some more recent discussions on using IPC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/04/set-floor-level-and-use-ipc-for-disentanglement.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/04/set-floor-level-and-use-ipc-for-disentanglement.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/09/scaling-an-add-in-for-a-4k-high-resolution-screen.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/09/scaling-an-add-in-for-a-4k-high-resolution-screen.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/09/ui-top-forms-buttons-web-etc.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/09/ui-top-forms-buttons-web-etc.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/11/integrating-the-helix-3d-viewer-with-a-wpf-add-in.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/11/integrating-the-helix-3d-viewer-with-a-wpf-add-in.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 11:00:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9276488#M37063</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-01-27T11:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9281197#M37064</link>
      <description>&lt;P&gt;Mr. Tammik, I really appreciate for your prompt answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm curious about entry point. The only way I know in order to load my customized code(dll) is implementing external command, but you said to me forget about external command. Does revit have another interfaces to import customized code?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 02:46:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9281197#M37064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-29T02:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9281472#M37065</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Revit API is completely event driven.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many (or most? or all?) of the Revit events provide a valid Revit API context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at the&amp;nbsp;Autodesk.Revit.DB.Events Namespace:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2020/b86712d6-83b3-e044-8016-f9881ecd3800.htm" target="_blank"&gt;https://www.revitapidocs.com/2020/b86712d6-83b3-e044-8016-f9881ecd3800.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 06:18:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9281472#M37065</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-01-29T06:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297095#M37066</link>
      <description>&lt;P&gt;Mr. Tammik, I have one more question.&lt;/P&gt;&lt;P&gt;From the link you gave me&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/04/set-floor-level-and-use-ipc-for-disentanglement.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/04/set-floor-level-and-use-ipc-for-disentanglement.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found an example code "IPC_test_revit_plugin.zip".&lt;/P&gt;&lt;P&gt;There were a browser project and a revit-addin project. Is this addin(external command) able to listen messages from other applications until the revit program is terminated?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 02:56:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297095#M37066</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-05T02:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297281#M37067</link>
      <description>&lt;P&gt;An external command listens to one message only, and nothing else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only message an external command is ever interested in is the &lt;U&gt;Execute&lt;/U&gt; message that it implements a handler for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only instance that can send that message is Revit.exe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only time the message is sent is when Revit.exe wishes the external command to be executed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 07:13:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297281#M37067</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-02-05T07:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297329#M37068</link>
      <description>&lt;P&gt;Ah, what I exactly want is to develop custom DLL which can be loaded in Revit that listens messages from another process(application) during Revit is running. Is it possible to implement?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 07:45:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297329#M37068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-05T07:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297347#M37069</link>
      <description>&lt;P&gt;Yes, using an external event:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, Revit is not designed for that purpose and you may violate the license by doing so.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For that purpose, a DA4R application may be a more appropriate choice:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.55" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.55&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 07:55:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297347#M37069</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-02-05T07:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297880#M37070</link>
      <description>&lt;P&gt;In yet another vain attempt at not having to repeat myself in the future, I publish our discussion for posterity:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2020/02/external-communication-and-async-await-event-wrapper.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2020/02/external-communication-and-async-await-event-wrapper.html#3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="gtx-trans" style="position: absolute; left: 31px; top: -20px;"&gt;
&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Feb 2020 11:33:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9297880#M37070</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-02-05T11:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9300009#M37071</link>
      <description>&lt;P&gt;I found a post in your blog. Can it be a solution for me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2012/11/drive-revit-through-a-wcf-service.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2012/11/drive-revit-through-a-wcf-service.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 04:16:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/9300009#M37071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-06T04:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Revit addin communicating with other process</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/10134135#M37072</link>
      <description>&lt;P&gt;Hey there, yes you can do this. I'm just wrapping up work on an addin that does precisely this. The code is too rough to share at the moment but I will try and post a working sample later.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The general gist of the flow goes like this though:&lt;BR /&gt;&lt;BR /&gt;* When your ICommand runs it's execute method, you use &lt;FONT face="lucida sans unicode,lucida sans" size="2"&gt;ExternalEvent.Create()&lt;/FONT&gt; to create the ExternalEvent handlers that'll you'll use to communicate back and forth to Revit asynchronously.&lt;BR /&gt;* Then use &lt;FONT face="lucida sans unicode,lucida sans" size="2"&gt;var pipeThread = Thread.Start()&lt;/FONT&gt;, and pass it a callback function that starts your named pipe server, and can access those ExternalEvent handlers that you created.&lt;/P&gt;&lt;P&gt;* Then to keep your server thread alive and open after you start it, just call &lt;FONT face="lucida sans unicode,lucida sans" size="2"&gt;pipeThread.Join()&lt;/FONT&gt; before your ICommand finishes it's execute function.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 20:12:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-addin-communicating-with-other-process/m-p/10134135#M37072</guid>
      <dc:creator>mastjaso</dc:creator>
      <dc:date>2021-03-05T20:12:05Z</dc:date>
    </item>
  </channel>
</rss>

