In a python node for Dynamo 3.2 in Revit 2025 if I try adding the following reference, I get a warning related to System.Windows.Forms.Context menu not being loaded. Just to note, I have been using this import in my py template for several years and never had an issue before.
clr.AddReference('System')
from System.Collections.Generic import List
This may not be related but something i noticed. It is wise that you make this imported list name different as i show below. This stops the chance of this import causing a conflict with the python List.
#Imports Ilists module into python
clr.AddReference("System")
from System.Collections.Generic import List as cList
Well as I usually tell folks, look at the Message and actually READ it. What is it telling you? Still don’t know why it is a dependency, but I’ll save that for another day.
So, what it was telling me is that once again I think CTC is mucking stuff up for us.
Using Revit Lookup (greatest single Revit plugin ever!) it looks like they are loading an older version of System.Windows.Forms. So, if I disable their plugin, boom, works just like it should.
Thanks @Thomas_Mahon, I think I found it’s a conflict with another software. They actually just released an update recently that I am going to try and see if it resolves for me.
Before you update: enable the CTC stuff, then start Revit and open a Dynamograph and finally force quit Revit.
Grab that journal and flag any and all API_ERROR lines. After the CTC update do the same and confirm that the number goes down; if not you may still have more to clean up.
Thanks @jacob.small, but unfortunately the journal didn’t have any information in it related to that add-in or any other to be honest, however working with support they have recreated the issue including it not happening when it is disabled.