Difficulty to run python in Civil 3D

Dear all,

I am having difficulty to run python in Civil 3D. I get “Unknown command “PYTHON”” warning.

I am using Civil 3D 2023 and Dynamo v.2.16.1.

I installed CivilConnection2023 and I can get nodes in Dynamo.

I copied the “CivilPython.bundle” into the correct place: C:\ProgramData\Autodesk\ApplicationPlugins

I wonder the version of .NET Framework matters. Which version should I install? I tried 4.7 and 4.8 both.

Any ideas how to resolve this issue?

Thanks

OK. I think there is a problem at the PackageContents.XML file for the 2023 version of CivilPython.bundle.

When this is modified, Python runs in Civil 3D.

However, this time I get an “Unhandled Exception” problem when I just start Civil 3D. This does not affect Dynamo coding.

Any ideas what this means?

Thanks
Exception

It happens a lot on me when I have error in my coding too.
The only way to prevent it is to avoid syntax error.
Civil3D and dynamo is really bad

If you are creating Python code within Dynamo from the Python node, and you are using a later version of Dynamo than 2.13.

Then i would suggest you look to see if it is set as CPython or IronPython, if it is set to Ironpython then you need to download the IronPython package because this is no longer shipped with dynamo.

More info about this here: Dynamo Core 2.13 Release - Part 3/3 - Dynamo BIM

Also it could be that you are using Ironpython code which is not compatible with Cpython code, so this is worth a check as well.

I have the same problem.

In my case the software crashes when the python-node gets a “null”-input, but the problem is not in every node.
There must be a problem in the code.

My solution is to replace the input to an “empty list” if it is “null” until i find a better one.

Hello @mtanyer ,
after the installation of the “CivilPython.bundle”, the commands in Civil 3D should be recognized after you change the “C:\ProgramData\Autodesk\ApplicationPlugins\CivilPython.bundle\PackageContents.xml” → “SeriesMax” =“R24.2”

To avoid the unhandled exception error, open Dynamo and install also the “DynamoIronPython3” package.

Hi Karsten.Saenger and all,
I have installed the DynamoIronPython3” package as suggested. However, I still get the “Unhandled Exception” warning.
I can run the code; no problem with that. But why do I get this warning?
Regards,

Hello, I also have the same problem. I am not able to run civilconnection for Revit2023 and Civil3d 2023.
I made the changes you recommended, but in civil3d, when I run -pxthon, I get an error.
error civilconnection c3d

Does anyone know how to install civilconnection for revit and c3d 2023?

Thanks!

@Paolo_Emilio_Serra1 Please, some help. :wink:

I’m looking for a solution for this same problem, it seems that civil 3d doesn’t suport just in time debugging, but it’s not told where we can debug it. Is so annoying to always restart completly the software…

Did you resolve your problem yet, can show me more detail you are facing ?