Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error importing C3D dll

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
tom.povey
5012 Views, 8 Replies

Error importing C3D dll

tom.povey
Enthusiast
Enthusiast

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:

https://forums.autodesk.com/t5/autocad-civil-3d-customization/civil-3d-dll-error-when-importing-into...

 

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

 

 

0 Likes

Error importing C3D dll

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:

https://forums.autodesk.com/t5/autocad-civil-3d-customization/civil-3d-dll-error-when-importing-into...

 

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

 

 

8 REPLIES 8
Message 2 of 9

Civil3DReminders_com
Mentor
Mentor

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.

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
0 Likes

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.

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 3 of 9

tom.povey
Enthusiast
Enthusiast

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

 

0 Likes

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

 

Message 4 of 9

augusto.goncalves
Alumni
Alumni

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. 

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes

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. 

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 5 of 9

tom.povey
Enthusiast
Enthusiast

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?

 

 

 

CAD Import.PNG

 

Civil Import.PNG

 

 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

 

 

 

 

 

 

 

 

 

 

0 Likes

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?

 

 

 

CAD Import.PNG

 

Civil Import.PNG

 

 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

 

 

 

 

 

 

 

 

 

 

Message 6 of 9
tom.povey
in reply to: tom.povey

tom.povey
Enthusiast
Enthusiast

Anyone have any ideas?

0 Likes

Anyone have any ideas?

Message 7 of 9
atultegar
in reply to: tom.povey

atultegar
Participant
Participant
Accepted solution

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.Reading Civil 3D instance in DynamoReading Civil 3D instance in Dynamo

 

 

Thanks

0 Likes

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.Reading Civil 3D instance in DynamoReading Civil 3D instance in Dynamo

 

 

Thanks

Message 8 of 9
tom.povey
in reply to: atultegar

tom.povey
Enthusiast
Enthusiast

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!

0 Likes

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!

Message 9 of 9
Anonymous
in reply to: tom.povey

Anonymous
Not applicable

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

0 Likes

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.

Post to forums  

Rail Community


Autodesk Design & Make Report