Hi all,
I hope I'm posting this in an appropriate place for starters.
I'm using IronPython, I'm trying to import the AeccDbMgd.dll assembly which has that Autodesk.Civil namespace, but I haven't had any luck. I can import the standard AutoCAD assemblies no problem, but i recieve this error when importing the civil dll:
IOError: [Errno 2] Could not load file or assembly ‘AeccDbMgd.dll’ or one of its dependencies. The specified module could not be found.
Here is my code:
import sys sys.path.append(r'C:\Program Files\Autodesk\AutoCAD 2016\C3D') import clr clr.AddReferenceToFile('AeccDbMgd.dll')
I am using the IronPython interpreter inside Dynamo if that makes any difference.
I found this post on the forums from around a year ago but it doesn't have a solution:
The Autodesk developers guide states:
Browse to the install directory for AutoCAD Civil 3D, and select the base libraries acdbmgd.dll, acmgd.dll, accoremgd.dll, AecBaseMgd.dll, and AeccDbMgd.dll. Note: These are the base AutoCAD and AutoCAD Civil 3D managed libraries. Your .NET assembly can use classes defined in additional libraries.
Thanks for reading,
Tom
Solved! Go to Solution.
Hi all,
I hope I'm posting this in an appropriate place for starters.
I'm using IronPython, I'm trying to import the AeccDbMgd.dll assembly which has that Autodesk.Civil namespace, but I haven't had any luck. I can import the standard AutoCAD assemblies no problem, but i recieve this error when importing the civil dll:
IOError: [Errno 2] Could not load file or assembly ‘AeccDbMgd.dll’ or one of its dependencies. The specified module could not be found.
Here is my code:
import sys sys.path.append(r'C:\Program Files\Autodesk\AutoCAD 2016\C3D') import clr clr.AddReferenceToFile('AeccDbMgd.dll')
I am using the IronPython interpreter inside Dynamo if that makes any difference.
I found this post on the forums from around a year ago but it doesn't have a solution:
The Autodesk developers guide states:
Browse to the install directory for AutoCAD Civil 3D, and select the base libraries acdbmgd.dll, acmgd.dll, accoremgd.dll, AecBaseMgd.dll, and AeccDbMgd.dll. Note: These are the base AutoCAD and AutoCAD Civil 3D managed libraries. Your .NET assembly can use classes defined in additional libraries.
Thanks for reading,
Tom
Solved! Go to Solution.
Solved by atultegar. Go to Solution.
I haven't done it in Python.
In Visual Studio if you add AeccDbMgd.dll it will indicate it is missing AecBaseMgd.dll. I'd suggest importing AecBaseMgd.dll and then AeccDbMgd.dll.
I haven't done it in Python.
In Visual Studio if you add AeccDbMgd.dll it will indicate it is missing AecBaseMgd.dll. I'd suggest importing AecBaseMgd.dll and then AeccDbMgd.dll.
Cheers for the reply but I already had that imported, these are the ones I import:
acdbmgd.dll
acmgd.dll
accoremgd.dll
AecBaseMgd.dll
AeccDbMgd.dll
I can import the first four just fine, but when I get to the AeccDbMgd.dll, it throws the error.
That is the dll found in the Civil 3D folder: C:\Program Files\Autodesk\AutoCAD 2016\C3D
The ones that do work are found here: C:\Program Files\Autodesk\AutoCAD 2016
Thanks
Cheers for the reply but I already had that imported, these are the ones I import:
acdbmgd.dll
acmgd.dll
accoremgd.dll
AecBaseMgd.dll
AeccDbMgd.dll
I can import the first four just fine, but when I get to the AeccDbMgd.dll, it throws the error.
That is the dll found in the Civil 3D folder: C:\Program Files\Autodesk\AutoCAD 2016\C3D
The ones that do work are found here: C:\Program Files\Autodesk\AutoCAD 2016
Thanks
I'm not expert on Python, but have a question: are you running this inside Civil 3D? Note these references are for use in-process, so you need the product to use the APIs. If you plan to use as a standalone (or on other product), then it will not work.
I'm not expert on Python, but have a question: are you running this inside Civil 3D? Note these references are for use in-process, so you need the product to use the APIs. If you plan to use as a standalone (or on other product), then it will not work.
Hi Augusto,
I'm using this inside Dynamo, I didn't think it would work but I was able to grab the standard AutoCAD modules. I don't understand why it won't work for Civil 3D if it's working for AutoCAD?
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File "<string>", line 17, in <module>
IOError: [Errno 2] Could not load file or assembly 'AeccDbMgd.dll' or one of its dependencies. The specified module could not be found.
Thanks
Hi Augusto,
I'm using this inside Dynamo, I didn't think it would work but I was able to grab the standard AutoCAD modules. I don't understand why it won't work for Civil 3D if it's working for AutoCAD?
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File "<string>", line 17, in <module>
IOError: [Errno 2] Could not load file or assembly 'AeccDbMgd.dll' or one of its dependencies. The specified module could not be found.
Thanks
Anyone have any ideas?
Anyone have any ideas?
Hi,
You can use COM API to access Civil 3D inside Dynamo using Python node.
you can try below code, its for 2018 version. you only need to change folder path and ProgramID to use it for other versions of Civil 3D.
Thanks
Hi,
You can use COM API to access Civil 3D inside Dynamo using Python node.
you can try below code, its for 2018 version. you only need to change folder path and ProgramID to use it for other versions of Civil 3D.
Thanks
Hi @atultegar,
Thanks for this, I found this out a while ago, I didn't have much programming experience back then!
I should have updated my answer I apologies, thanks for updating this!
Hi @atultegar,
Thanks for this, I found this out a while ago, I didn't have much programming experience back then!
I should have updated my answer I apologies, thanks for updating this!
How did you guy's get on with this?
Does anyone have any code examples of how to insert a block or a polyshape from dynamo to Civil 3d.
Any code examples would be appreciated to get me started. I seen the Civil Connection videos but code for this seems unavailable to general Autodesk community at this time, so looking to write my own basic alternatives to get me started.
Any feedback most appreciated.
CJM
How did you guy's get on with this?
Does anyone have any code examples of how to insert a block or a polyshape from dynamo to Civil 3d.
Any code examples would be appreciated to get me started. I seen the Civil Connection videos but code for this seems unavailable to general Autodesk community at this time, so looking to write my own basic alternatives to get me started.
Any feedback most appreciated.
CJM
Can't find what you're looking for? Ask the community or share your knowledge.