accesing a part changing its parameters and exporting it using python
Hello,
I have seen a few years ago, people using python, and accessing to one of their files, changing the configuration and getting back the exported file. I need to do a parametric study of a geometry and i would love to be able to do this but did not find any good knowledge source for doing this. someone has an updated guide on how to do this? ideally with an example?
the idea is for example having a cylinder and changing its radius and height, either by a variable feature (variable in the tools in 3D space) or by creating a configuration variable, i dont care in which one, i could adapt to which is easier to do.
so the idea would be having a python script that, takes h(height), r(radius) and link to the file (and credentials if it is a private file), communicates with the onshape file, change this dimensions by changing either variable or configuration variable and exports the step file of all the solids (in this case the cylinder) and a step file for each face of the cylinder (using offset surface with offset=0, 3 times on each cylinder surface) created in a part studio.
Answers
-
I would start here:
https://learn.onshape.com/courses/intro-to-the-onshape-apiAlso, be aware that there are caps as to how many API calls you can make:
https://onshape-public.github.io/docs/auth/limits/0
