Execute Dynamo Script Through Revit API (Multiple Versions of Revit and/or Dynamo)

Execute Dynamo Script Through Revit API (Multiple Versions of Revit and/or Dynamo)

EATREVITPOOPCAD
Collaborator Collaborator
561 Views
1 Reply
Message 1 of 2

Execute Dynamo Script Through Revit API (Multiple Versions of Revit and/or Dynamo)

EATREVITPOOPCAD
Collaborator
Collaborator

https://forums.autodesk.com/t5/revit-api-forum/dynamo-script-in-revit-api/m-p/9087871#M41897

 

Found this great example here on how to run Dynamo scripts through c# addins. However, this only works if you have one version of dynamo installed. I would like to try to be able to run a script through my addin on multiple versions of Revit and have a couple of versions of dynamo installed...

 

I am assuming having the plugin work for multiple versions of Revit would be easy, just conditionally reference all of the Dynamo DLLs based on Revit version and/or .NET framework... Logically makes sense to me, but if I could have one of the wizards here confirm that, it would be nice...

 

The second question is more challenging for me, having this example, what do I have to do to be able to execute a script with multiple versions of Dynamo installed...

 

Here are some facts I discovered about Dynamo & Revit:

  • Up to Revit 2019, Dynamo Core & Dynamo For Revit installed in Dynamo Program Files
  • Revit 2020 and up, Dynamo Core & Dynamo For Revit are installed in the Revit Program Files Addins folder...

 

 

The definition of insanity is doing the same thing over and over again and expecting different results
0 Likes
562 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

This is probably more of a .NET question than Revit API.

 

Dynamo uses the Revit API .NET interface, just like all Revit add-ins.

 

All Revit API clients are loaded into one single AppDomain.

 

https://docs.microsoft.com/en-us/dotnet/api/system.appdomain

 

I assume you can use the methods it provides to determine what DLLs are loaded and what version of Dynamo or other clients you can communicate with.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open