Editing parts in Assembly 3 from Python Script

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Haybubay
Posts: 1
Joined: Tue May 09, 2023 4:02 am

Editing parts in Assembly 3 from Python Script

Post by Haybubay »

Hello everyone,

I have an assembly created with assembly 3 containing two parts (fixed together using point-plane distance constant). I would like to automatically edit certain dimensions of the individuals parts based on a a tolerance range and then recompile the assembly. I plan to do this multiple times (>1000) for tolerance analysis studies so would like to automate this. Eventually I would like to all for individual assembly parts outputted as .stp files for some post processing.

Is there a way to do this in python i.e change certain dimensions of the bodies and recompute the assembly while keeping the tolerances the same ? I attempted this with the attached code.


Any other pointers on how to achieve the goal would be much appreciated!

Thanks!
Attachments
test3.py
Python file
(1.35 KiB) Downloaded 24 times
Code screenshot
Code screenshot
assy3 screenshot.jpg (188.17 KiB) Viewed 1756 times
Post Reply