For some reason when I create a “Code Block” it won’t let me type anything in it. So I started looking and my version of dynamo is (core) 2.13.1.3887 (revit) 2.13.1.3891.
So I guess I have 2 questions:
Why can’t I type in my code block
Is there a way to update Dynamo that I’m not seeing?
Speckle
Pyrevit
EF Tools
Ideate Software: Style Manager Trial
HotGear - downloaded this because the Align addin wasn’t available for 2023 and this had it
DiRootsOne
BIM One - Color Splasher
COINS Section Box
How are you accessing 2.15? It is not yet available for Revit or any other toolset, so unless you are utilizing Dynamo Sandbox it could be related to an unsupported installation method.
I haven’t done anything with 2.15 yet, I was just thinking that could be one solution to my code block issue. The fact that I had not upgraded Dynamo.
It seemed like an odd solution because I have never had to upgrade it manually before, but thought I would ask.
In this case it’s likely a Revit add-in conflict. Start by disabling all Revit add-ins and see if the issue persists. Post a Revit journal and Dynamo log if so.
Every time we have seen the issue it has been a conflicting Revit add-in or Dynamo package. Disable all your add-ins and packages and see if it clears up. If not, post the journal and log as noted above.
If that does clear it out, re-enable things in small groups until you identify the issue.
Thank you, Jacob. Unfortunately, it is not up to me whether addins run or do not but is dictated by our IT department. I can only turn off those that run with my own priviledges and I will try that.
As a work around I now give titles to my code blocks, find these in my .dyn-file opened in a text editor, follow the id gained from there and enter my code manually, then reload the .dyn into Dynamo.
I have personally created such a Revit plugin for a client that makes CodeBlock node in Dynamo uneditable. While disabling the plugin itself (by moving .addin file elsewhere) does make the CodeBlock node work again, I’d like to share some thoughts here on the technical reasons and solutions:
Technical Reason:
The root cause of the problem in my case was, at the very start of my addin IExternalApplication.OnStartup() method, I collected all Types from all Assemblies in the Revit AppDomain, which caused Revit to actually load all those Assemblies and Types prematurely. Then when you run Dynamo later on, it tries to load its associated Types and Assemblies again, but they were already loaded beforehand, possibly from somewhere they’re not supposed to, and they cannot be replaced or re-loaded due to the innerworkings of .NET/C# environment where the plugins were made. This results in Dynamo running on the wrong Types and Assemblies that just happen to affect the CodeBlock node and possibly something extra.
It’s worth noting that pre-loading and collecting all Types and Assemblies in the Revit AppDomain might be a default behavior of some 3rd-party IOC Containers implemented by plugins. If your addins do implement IOC Containers then this might be the reason. I was able to fix my problem quickly because I wrote my own IOC Container and was able to switch the behavior to only load Assemblies and Types related to my own plugin.
Solution:
Disable Generative Design for Revit. Yeah the problem is actually caused by Generative Design plugin, not Dynamo per se. Go to C:\Program Files\Autodesk\Revit 2023\AddIns\GenerativeDesignForRevit, or wherever it is installed on your machine, and disable GenerativeDesignForRevit.addin file. You can simply rename it to GenerativeDesignForRevit.addinx
Or
Tell your plugin maker to switch their IOC Container behavior as described above, or just do not pre-load all Assemblies and Types from Revit AppDomain, only load what they need.