Zero Touch Debugging

Hey guys, I’ve been getting started with Zero Touch node development but I wanted to know if there’s a better way to debug that I’m missing:

  • As I understand it now, every single time you want to load in a new version of your DLL file you have to fully exit both Dynamo and Revit and then restart both before the Revit process will let go of the DLL file. Is this really the case? Does anyone have any work arounds so that you don’t have to keep closing and opening Revit?

If you want to test them as nodes, alas that’s the only option. This is a c# limitation. Because Dynamo shares Revit’s app domain (which is the only way to work with Revit’s api), any assembly loaded into dynamo gets locked down until you close down the Revit instance.

If you’d just like to test out the code and bypass the ZT to node conversion, maybe dynamically loading assemblies from byte arrays could be an option.

You can also check the dynamic c# interpreter in the package manager, however your code will require some modifications.


Ah that’s too bad, I figured that was kind of the case. But that dynamic loading looks interesting, when I get some time I’ll try it out and see if that can be used in a testing node. Thanks!

So for anyone coming across this the best/easiest solution I came up with was to restructure my solution a bit. My Visual Studio solution now consists of 3 projects; one that acts as a dynamo shell (handles all the interfacing with dynamo, converting to and from revit geometry / elements, and transaction management); one that acts as a revit add-in shell (a super lightweight IExternal Command class that gathers the elements I need as input (simulating dynamo’s job)), and a common library (pretty much all the actual code logic and a runmain class that gets called by both either shell).

So to test the majority of my code I just rerun the revit add-in using Add-In manager. It doesn’t help as much if you’re doing a lot of stuff with dynamo, but most of what I’m doing is on the revit end anyways so this system works well.

I also want to check my code in dynamo faster, is there any utility like addin manager?