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.
From Python to FeatureScript - best practice?
martin_simon
Member Posts: 1 PRO
Hello guys!
I am new to OnShape. I plan to use it inside an optimization algorithm and would like to know the cleanest way to do parametric modeling from a Python script.
Thanks!
I am new to OnShape. I plan to use it inside an optimization algorithm and would like to know the cleanest way to do parametric modeling from a Python script.
Thanks!
0
Comments
-
If you want to do regeneration as part of an optimization loop, then you can write your optimization in Python and use the API rather than FeatureScript. (I think https://www.onshape.com/api-access will get you there and there are python examples) If you want to do optimization *inside* the regeneration, you can do some in FeatureScript, but it is not currently suitable for heavy computation.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0
-
@ilya_baran,ilya_baran said:If you want to do regeneration as part of an optimization loop, then you can write your optimization in Python and use the API rather than FeatureScript. (I think https://www.onshape.com/api-access will get you there and there are python examples) If you want to do optimization *inside* the regeneration, you can do some in FeatureScript, but it is not currently suitable for heavy computation.
The link you gave doesn't take you to anything to do with api-access. Is there a different url that will?0 -
Sorry, that link was removed since I posted it. The API start point is https://dev-portal.onshape.com/ but we have not yet made it particularly user-friendly... There is some amount of documentation here: https://dev-portal.onshape.com/helpIlya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0


