System.IO.FileNotFoundException: Could not load file or assembly 'AecPropDataMgd' or one of its dependencies

When adding the following assemblies inside Dynamo, everything seems to work fine.

clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')

However, if I try to do the same in VS Code, I get the error:

System.IO.FileNotFoundException: Could not load file or assembly 'AecPropDataMgd' or one of its dependencies. The system cannot find the file specified.

What could be the problem? Other imports like ‘aecbasemgd’, ‘protogeometry’ seem to work just fine.

Likely you have to add the path directly so that VS knows where to find the assembly. You’re in an IDE so these assemblies aren’t necessarily running already unlike in the Dynamo context.

That said, if you’re in Visual Studio skip right past Python and use C# and build a zero touch node. Otherwise you will have significant issues with the limitations of Python and C# wrappers.

1 Like

Were you able to resolve this issue? I’m having the same problem and I’ve tried adding the following paths with no luck:

sys.path.append(r’C:\Program Files\Autodesk\AutoCAD 2022’)
sys.path.append(r’C:\Program Files\Autodesk\AutoCAD 2022\C3D’)
sys.path.append(r’C:\Program Files\Autodesk\AutoCAD 2022\ACA’)

Please provide your solution if you have one.

Jacob, I’m having the same issue and tried adding the following paths with not luck:

sys.path.append(r’C:\Program Files\Autodesk\AutoCAD 2022’)
sys.path.append(r’C:\Program Files\Autodesk\AutoCAD 2022\C3D’)
sys.path.append(r’C:\Program Files\Autodesk\AutoCAD 2022\ACA’)

Do you know if other paths should be added?

Are you doing this in the Dynamo Python editor or something else?

1 Like

I’m just using a text editor and running the script with python 3.12 interpreter. I just found that it works if I run using the embeddable 3.8 interpreter installed by Dynamo. However, would prefer to have the flexibility of using a different interpreter if possible. But it’s not a huge deal if this is not possible.

You can save the text to a .txt or .py file and load it into the Dynamo interpreter. Executing from another tool will be difficult as you can’t load in the libraries from outside the main process (AutoCAD which hosts Civil 3D which hosts Dynamo which hosts the Python interpreter).

1 Like

Thanks Jacob for your help. It looks like the Dynamo development team is focused on supporting CPython and the latest releases going forward so using the dynamo interpreter should not be an issue.

1 Like