Converting 3D model to Python script (AutoCAD API)

Converting 3D model to Python script (AutoCAD API)

popovUS9BY
Advocate Advocate
98 Views
5 Replies
Message 1 of 6

Converting 3D model to Python script (AutoCAD API)

popovUS9BY
Advocate
Advocate

Hello Plant3D users,

 

is there option to convert AutoCAD 3D solid into Python script usable in Plant3D?

 

This is the example model:

clamp-dn250.PNG

 

I asked ChatGPT and got this:

clamp-script.PNG

 

What is "AutoCAD's API"?

Do I need some Python script software to install to start creating parametric models?

 

Regards

 

0 Likes
99 Views
5 Replies
Replies (5)
Message 2 of 6

h_eger
Mentor
Mentor

@popovUS9BY ,

 

Part 1 - 5

https://adndevblog.typepad.com/autocad/2016/01/custom-python-scripts-for-autocad-plant-3d-part-5.htm...

-

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



Message 3 of 6

matt.worland
Advisor
Advisor

I am not aware of any tools that would do that.

You would need to use the AutoCAD API to dissect every shape into its individual primitive shapes (e.g., cylinders, boxes, spheres) that align with the Python script capabilities. This link describes the concept of extracting Geometry from a 3d model: https://adndevblog.typepad.com/autocad/2013/07/extracting-the-raw-geometry-from-plant3d-objects.html

Next, write code that maps the AutoCAD shape to a Python shape. Then have it write the python code to generate the parts. This would be very involved and would take a fair amount of effort.  

Learning the basics of the Python Scripting that @h_eger mentions would be the first place to start. Once you have mastered how to create these items manually with python, you could then learn the AutoCAD API to extract the shapes and write the code to generate the python scripts.

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
Message 4 of 6

popovUS9BY
Advocate
Advocate

Hello Mr. Worland,

thanks for reply.

 

Looks like links does not work.

However I'll try to start ...

 

Regards

0 Likes
Message 5 of 6

matt.worland
Advisor
Advisor

I really hope Autodesk has a solution to restore all of the old blog posts.

@Tarek_K 

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
0 Likes
Message 6 of 6

CGBenner
Community Manager
Community Manager

@matt.worland 

Hello, the old blogs for the Autodesk Developer Network are outside of the platform that we manage, I would recommend reaching out to someone on this Contact Us page for ADN.  Maybe they have some information regarding the old blog posts.  Good luck!

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes