<?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: Passing Document instance as argument to external .exe in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11690090#M14428</link>
    <description>&lt;P&gt;Here are some links that might help. I have not checked them all, and there may be others as well, possibly more relevant ones. I just searched the titles for 'reload' and weeded out unrelated topics:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2010/03/reload-an-addin-to-debug.html" target="_blank" rel="noopener"&gt;Reload an Add-In to Debug&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2012/12/reload-add-in-for-debug-without-restart.html" target="_blank" rel="noopener"&gt;Reload Add-in for Debug Without Restart&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2013/05/reloading-and-debugging-external-commands-on-the-fly.html" target="_blank" rel="noopener"&gt;Reloading and Debugging External Commands on the Fly&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2016/03/index-reloading-curves-distance-and-deleting-printsetup.html" target="_blank" rel="noopener"&gt;Index, Debug, Curves, Distance, Deleting PrintSetup&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2023 08:38:56 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2023-01-19T08:38:56Z</dc:date>
    <item>
      <title>Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11686875#M14417</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all - I am familiar with Jeremy's post concering running executable file directly from Revit Command:&lt;/P&gt;&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2014/07/launching-a-stand-alone-executable.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2014/07/launching-a-stand-alone-executable.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering - did anyone of you try to pass active Document as an argument to external application .exe (my custom application) or does anyone have any idea how this problem can be approached?&amp;nbsp; So basically Revit-Command(RvtCmd) would execute exe file, and before the external application is executed, command (RvtCmd) also sends information about current active Document to this application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best, Lukasz&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 00:47:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11686875#M14417</guid>
      <dc:creator>lwlXUTTT</dc:creator>
      <dc:date>2023-01-18T00:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11686982#M14418</link>
      <description>&lt;P&gt;Generally, if you want to pass complex data across processes, you need to serialize it to string in one process and pass the string to another process where the string is to be deserialized to memory object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Revit Document object is a much more complicated object that internally has references to many other Revit objects in Revit memory, which means serialization is nearly impossible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of cloning and transplanting&amp;nbsp;&lt;SPAN&gt;Einstein's brain to your head, why not hiring&amp;nbsp;Einstein to work for you. All you need to do is communication.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A possible approach is to create a local C/S architect by hosting an HTTP server inside Revit. The server exposes specific APIs locally. External applications can make HTTP requests to the server to get the results they want without caring about how the results are generated.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 02:33:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11686982#M14418</guid>
      <dc:creator>Kennan.Chen</dc:creator>
      <dc:date>2023-01-18T02:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687273#M14419</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6435443"&gt;@lwlXUTTT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if it helps but&amp;nbsp;&lt;SPAN&gt;there is an example of External Events available in the Revit SDK. Look for "ModelessDialog" in the Samples folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.autodesk.com/developer-network/platform-technologies/revit" target="_blank" rel="noopener"&gt;https://www.autodesk.com/developer-network/platform-technologies/revit&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 06:39:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687273#M14419</guid>
      <dc:creator>moturi.magati.george</dc:creator>
      <dc:date>2023-01-18T06:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687638#M14420</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your hints,&lt;/P&gt;&lt;P&gt;Maybe I will also clarify my goals and why I stated my question like this.&lt;/P&gt;&lt;P&gt;I want to add simple .DLL to Revit (Application layer) only once (simple button), that would open a window with "Control Panel" to e.g. Print all Sheets from the Document without having this Document Open.&lt;/P&gt;&lt;P&gt;This is easy.&lt;/P&gt;&lt;P&gt;However, I know that working on the solution (external application) would be continuous work, so I will have to change my external application many times and I don't want everyone in my office to load new .DLL all the time, but instead -&lt;/P&gt;&lt;P&gt;have a button (trigger) which would refer to external application (so button doesn't change, but the external application constantly changes). Button .DLL would be loaded only once by everyone in the office and I would not have to bother anyone with new updates of .DLL....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas, what would be then the best approach to such a problem?&lt;/P&gt;&lt;P&gt;Many thank to all suggestion in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lukasz&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 10:30:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687638#M14420</guid>
      <dc:creator>lwlXUTTT</dc:creator>
      <dc:date>2023-01-18T10:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687707#M14421</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6435443"&gt;@lwlXUTTT&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you might need to publish your app to the Autodesk Exchange Store where all your users will get your changes as you develop. There might be a better way of doing it which might be suggested by other forum users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a video tutorial on how to go about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=D_MpPk3nsME&amp;amp;list=PL4CYqBFEfhpJakE-DAuchu785fU_RkAfs" target="_blank"&gt;https://www.youtube.com/watch?v=D_MpPk3nsME&amp;amp;list=PL4CYqBFEfhpJakE-DAuchu785fU_RkAfs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 11:03:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687707#M14421</guid>
      <dc:creator>moturi.magati.george</dc:creator>
      <dc:date>2023-01-18T11:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687741#M14422</link>
      <description>&lt;P&gt;I don't think this approach will be possible, the .dll is being locked by Revit.exe , you won't be able to access&lt;BR /&gt;it in order to do the swap between the old and the new while others using Revit.&lt;BR /&gt;&lt;BR /&gt;If you have on-premesis server, you can run a worker service porject which will monitor the status of&lt;BR /&gt;each .dll you want to swap and if it isn't being used the worker will swap the files while the user isn't&lt;BR /&gt;using Revit.exe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can't Run Documnet object outside of the revit engine, thats why you have Forge and APS for ...&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 11:22:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687741#M14422</guid>
      <dc:creator>TomB.ADV</dc:creator>
      <dc:date>2023-01-18T11:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687818#M14423</link>
      <description>&lt;P&gt;Maybe&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp; might have a solution for your question&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 11:51:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11687818#M14423</guid>
      <dc:creator>moturi.magati.george</dc:creator>
      <dc:date>2023-01-18T11:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11688059#M14424</link>
      <description>&lt;P&gt;You can simply split your application into separate classes, and host the different classes in different .NET assembly DLLs. For example, the&amp;nbsp;FireRatingCloud sample includes a Revit add-in DLL that accesses a class defined and implemented in a separate DLL class library that can also be used by other clients:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/FireRatingCloud" target="_blank"&gt;https://github.com/jeremytammik/FireRatingCloud&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The separate DLL class library could also reference the Revit API, and it could be swapped at will.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 13:20:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11688059#M14424</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-01-18T13:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11689298#M14425</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you for the suggestion,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if I understand your answer correctly, any update of referenced/split DLL would require the restart of Revit Application ? (assuming that my application is implmenting IExternalApplication interface)&lt;/P&gt;&lt;P&gt;So to emphasize my goal - I would like to ask you one more time more specifically:&lt;/P&gt;&lt;P&gt;- is there a way to e.g. build a solution in Visual Studio to obtain new DLL and without closing Revit Application, run a command directly from Revit (implementing IExternalCommand interface), which would already use freshy exported DLL library from Visual Studio ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lwlXUTTT_0-1674078482170.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1164333i3AB5A5D9983A0EC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lwlXUTTT_0-1674078482170.png" alt="lwlXUTTT_0-1674078482170.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope the graph also helps to visualize my intension,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be enourmously grateful for any suggestions in this direction,&lt;/P&gt;&lt;P&gt;Regards, Lukasz&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 21:49:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11689298#M14425</guid>
      <dc:creator>lwlXUTTT</dc:creator>
      <dc:date>2023-01-18T21:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11689479#M14426</link>
      <description>&lt;P&gt;It might be possible to use &lt;A href="https://learn.microsoft.com/en-us/dotnet/framework/app-domains/shadow-copy-assemblies" target="_blank" rel="noopener"&gt;Shadow Copying&lt;/A&gt; to do this. Calling the&amp;nbsp;SetShadowCopyFiles() method on the current AppDomain does change its&amp;nbsp;ShadowCopyFiles property to true, even though that method is marked as obsolete. I'm not sure if this actually enables shadow copying though.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 23:52:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11689479#M14426</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2023-01-18T23:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11690077#M14427</link>
      <description>&lt;P&gt;The answer is yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One solution that I am aware of is to load your .NET class library code from a dynamic in-memory byte stream instead of a static file on the hard disk.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This topic has been discussed repeatedly and various solutions offered both here in the forum and by The Building Coder, often for the purpose of real-time debugging:&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.49" target="_blank" rel="noopener"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.49&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The very earliest as well as the most recent solutions to the latter,&amp;nbsp;real-time debugging, are not of interest to you, since it uses 'hot reloading' support from the Visual Studio debugger. For several years in between, that functionality did not work, and several people implemented and used byte-stream loaders to solve it instead. I think some of them used the method for seamless runtime deployment as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please do let us know how you end up solving this, so we can share it with the community. Please also let us continue discussing the question until you have reached a satisfactory conclusion. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 08:33:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11690077#M14427</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-01-19T08:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11690090#M14428</link>
      <description>&lt;P&gt;Here are some links that might help. I have not checked them all, and there may be others as well, possibly more relevant ones. I just searched the titles for 'reload' and weeded out unrelated topics:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2010/03/reload-an-addin-to-debug.html" target="_blank" rel="noopener"&gt;Reload an Add-In to Debug&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2012/12/reload-add-in-for-debug-without-restart.html" target="_blank" rel="noopener"&gt;Reload Add-in for Debug Without Restart&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2013/05/reloading-and-debugging-external-commands-on-the-fly.html" target="_blank" rel="noopener"&gt;Reloading and Debugging External Commands on the Fly&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2016/03/index-reloading-curves-distance-and-deleting-printsetup.html" target="_blank" rel="noopener"&gt;Index, Debug, Curves, Distance, Deleting PrintSetup&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 08:38:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11690090#M14428</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-01-19T08:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11764576#M14429</link>
      <description>&lt;P&gt;Good Evening Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This answer would be the continuation of the post above but also the problem investigated by me in this post:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/problem-with-modeless-form-window-which-implements-iwin32window/m-p/11757747#M69355" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/problem-with-modeless-form-window-which-implements-iwin32window/m-p/11757747#M69355&lt;/A&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The clue of both problems seems to be the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, following the discussion above, loading the "Logic Assembly" into Byte Array worked really well.&lt;/P&gt;&lt;P&gt;However, there is one issue I am struggling with - but first implementation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//implementation of 'Reader' class
public class ExternalAssemblyByteArrayReader
{
   //ctor
   public ExternalAssemblyByteArrayReader(string assemblyFilename)
   {
      byte[] assemblyBytes = File.ReadAllBytes(assemblyFilename);

      //static property assigned to External Application (IExternalApplication)
      Application.Assembly = Assembly.Load(assemblyBytes);
   }

   public void Launch(Assembly assembly, object data, string commandName, string methodName)
   {
      Type typ = assembly.GetType(commandName);
      object cmd = assembly.CreateInstance(typ.FullName);

      object[] args = new object[0];
      if (data is ExternalCommandData)
      {
         string message = null;
         Autodesk.Revit.DB.ElementSet elements = null;

         args = new object[] { data as ExternalCommandData, message, elements };
      }
      else if(data is UIControlledApplication)
      {
         args = new object[] { data as UIControlledApplication};
      }
            
      BindingFlags flags = (BindingFlags) ((int)BindingFlags.Default | (int)BindingFlags.InvokeMethod);
      typ.InvokeMember(methodName, flags, null, cmd, args);
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//"Reader" class implemented into Revit interfaces

//External Application
public class Application : IExternalApplication
{
   public static Assembly Assembly { get; set; }
   public static ExternalAssemblyByteArrayReader Reader{ get { return _reader; } }

   private static ExternalAssemblyByteArrayReader _reader;

   public Result OnStartup(UIControlledApplication uiControlledApp)
   {
      ExternalAssemblyByteArrayReader reader = new ExternalAssemblyByteArrayReader(assemblyPath);
      _reader = reader;
      reader.Launch(Application.Assembly, uiControlledApp, "LinkedDLL.MainApplication", "OnStartup");

      return Result.Succeeded;
   }
}


//External Command
public class SampleCommand : IExternalCommand
{
   public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
   {
      Application.Reader.Launch(Application.Assembly, commandData, "LinkedDLL.MainWindowCommand", "Execute");
      return Result.Succeeded;
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution works, however there is important thing to be considered:&lt;/P&gt;&lt;P&gt;Loaded Assembly would have to be defined(loaded) &lt;STRONG&gt;OnStartup&lt;/STRONG&gt; in order to preserve values of static properties, which are declared in External Application. Otherwise, with every external command fired, new instance of updated Assembly is loaded and all declared static properties are reset to null. As a consequence of this limitation, every change in code (including changes to IExternalCommands) will have to be predecessed with Revit restart.... &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore I would like to suggest a new direction of my interrogation:&lt;/P&gt;&lt;P&gt;Is there a way to load/update an Assembly &lt;STRONG&gt;only partially,&lt;/STRONG&gt; in a way that Loaded Assembly 'OnStartup' remains &lt;STRONG&gt;untouched&lt;/STRONG&gt; (keeping the values of all members assigned during ExternalApplication Runtime), apart form a specific class?&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;only Type of Name == "UpdatedCommand" and which implements IExternalCommand interface will be updated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As usual I would be extremally grateful for any suggestion/hints,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice evening,&lt;/P&gt;&lt;P&gt;Lukasz&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 19:03:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11764576#M14429</guid>
      <dc:creator>lwlXUTTT</dc:creator>
      <dc:date>2023-02-18T19:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11764603#M14430</link>
      <description>&lt;P&gt;You ask:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;Is there a way to load/update an Assembly&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;only partially?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Yes, of course. Using your approach, you can load a single class at a time. So, some classes could be loaded up front and be persistent, and others could be loaded and updated dynamically any time you like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 19:37:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11764603#M14430</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-02-18T19:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11764650#M14431</link>
      <description>&lt;P&gt;It all depends on your end goal, if you need to load an assembly library on the fly in the release version of your plugin, probably your approach gonna work. You already find out some of the consequences of using &lt;STRONG&gt;Assembly.Load&lt;/STRONG&gt;, and if is not part of your main plugin, you should not use &lt;STRONG&gt;Assembly.Load&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if you only want to update &lt;STRONG&gt;IExternalCommand&lt;/STRONG&gt; and &lt;STRONG&gt;IExternalApplication&lt;/STRONG&gt; with Revit open without the need to close and open Revit.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is my approach using &lt;A href="https://ricaun.com/apploader/" target="_blank" rel="noopener"&gt;AppLoader&lt;/A&gt;.&lt;BR /&gt;&lt;div class="video-embed-center video-embed"&gt;&lt;iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9BslI_JnV6Y%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9BslI_JnV6Y&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9BslI_JnV6Y%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" width="200" height="112" scrolling="no" title="ricaun.AppLoader - English" frameborder="0" allow="autoplay; fullscreen; encrypted-media; picture-in-picture;" allowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;BR /&gt;Has some minimal limitations with some Revit Api methods that only work in the Revit initialize process (Register Warnings or DockablePane).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the end, the loaded plugin gonna work in the same way as loaded by Revit.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 20:29:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11764650#M14431</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2023-02-18T20:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11768450#M14432</link>
      <description>&lt;P&gt;Dear Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your answer. I have tried to kick-off with you suggestion, but I couldn't find a point to start. May I ask you for a reference to solution sample? For me it is not clear whether the 'partial assembly reading' should happen already during on AllBytesReading or during the Loading of the assembly? alternatively during the invoking of specific method?&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;byte[] assemblyBytes = File.ReadAllBytes(assemblyFilename);
Assembly LoadedAssembly = Assembly.Load(assemblyBytes);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As usual, I would be grateful for your help,&lt;/P&gt;&lt;P&gt;Best Regards, Lukasz&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 22:40:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11768450#M14432</guid>
      <dc:creator>lwlXUTTT</dc:creator>
      <dc:date>2023-02-20T22:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Document instance as argument to external .exe</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11769241#M14433</link>
      <description>&lt;P&gt;I have no experience with this myself. All I can do is search the Internet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://duckduckgo.com/?q=bytestream+load+.net+class+c%23" target="_blank"&gt;https://duckduckgo.com/?q=bytestream+load+.net+class+c%23&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://stackoverflow.com/questions/8734487/c-sharp-class-to-byte-stream" target="_blank"&gt;https://stackoverflow.com/questions/8734487/c-sharp-class-to-byte-stream&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry. So, maybe it is more effective if you search for yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 08:50:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/passing-document-instance-as-argument-to-external-exe/m-p/11769241#M14433</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-02-21T08:50:29Z</dc:date>
    </item>
  </channel>
</rss>

