Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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_simonmartin_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!

Comments

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    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 Inc
  • brian_bradybrian_brady Member, Developers Posts: 505 EDU
    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,

    The link you gave doesn't take you to anything to do with api-access. Is there a different url that will?
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    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/help
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.