Custom Python Script misbehaving in AutoCAD Plant 3D 2025

Custom Python Script misbehaving in AutoCAD Plant 3D 2025

theshoaib.mughal
Advocate Advocate
1,925 Views
4 Replies
Message 1 of 5

Custom Python Script misbehaving in AutoCAD Plant 3D 2025

theshoaib.mughal
Advocate
Advocate

Hi,

 

I have been successfully using Python based custom component up untill version 2024. I have main library file encoded as PYD and it was made using Python 3.7.9, Cython 0..29.23. But with this recent upgrade to version 2025 has messed everything up. The PYD file no longer works. I have tried searching if they have changed the Python/Cython version compatibility but cannot find anything related to that in their documentation. Anyone has any idea about that?

0 Likes
Accepted solutions (1)
1,926 Views
4 Replies
Replies (4)
Message 2 of 5

h_eger
Mentor
Mentor

@theshoaib.mughal ,

 

AutoCAD Plant 3D 2025 Help | Autodesk AutoCAD Plant 3D 2025 Known Issues | Autodesk

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



0 Likes
Message 3 of 5

theshoaib.mughal
Advocate
Advocate
Accepted solution

hey h_eger,

 

I have come across this article and it trumped my hopes. Well, this was not an answer I was looking for so I kept on exploring and finally I have figured it out. Here is the solution to that specific problem,

 

You need to compile the PYD with following environment

  • Python 3.7.9
  • Cython 3.0.10
  • MSVC v14.39.33519
  • Windows Kits v10.0.22621.0

Basically the latest of everything and voila it works fine.

Message 4 of 5

maciekola
Observer
Observer

so from 2025 we need to compile our python files not only to pyc but to PYD ? and why if I see some custom supports created with python.py ( compiled to .pyc ) can be normal open in spec editor in plant 3d 2025 ? i really don't understand how it works can anybody explain me how is it working in autocad plant 3d 2025 version ? Will be grateful for any information 

0 Likes
Message 5 of 5

theshoaib.mughal
Advocate
Advocate

No,

 

If your puthon files are in PY format then you need not worry about. You can keep on using them. I was talking about the encoded PYTHON file which is unreadable by mundsne means. Kinda like a DLL file but for python. This file format is pre-compiled encoded python script. In AutoCAD version 2025+ they changed the Python/Cython version and therefore PYD file made for earlier versions was not working.

0 Likes