Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
accesing a part changing its parameters and exporting it using python
franco_otaola507
Member Posts: 23 EDU
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-api
Also, be aware that there are caps as to how many API calls you can make:
https://onshape-public.github.io/docs/auth/limits/