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.

Parametric model export with Python

thales_maiathales_maia Member Posts: 5 EDU
I  saw some posts related  to Python and OnShape, but couldn't find any doc about it. I appreciate if someone can point me a direction.


I use a finite element program for magnetic field. This program accept dxf as input. I was using FreeCAD with variables. Using Python, I update the variables, export dxf and import that automatic to my fem program.
I want to use it with OnShape. I know that is possible to model with variables. Is it possible to update those variables using Python and download a dxf?

Comments

  • thales_maiathales_maia Member Posts: 5 EDU
    No one?
  • pmdpmd Member, Developers Posts: 43 PRO
    You can in theory do this from Python using configurations and the Onshape API - I am not sure if there is a way to directly just set variables.

    One issue may be getting the drawing to change configuration - in Onshape (and their API) part studios and assemblies have configurations but drawings do not (a drawing can contain parts/assys with configurations).

    I do not see any documented way to get a DXF version of a sketch from a partstudio as a DXF but you can get a DXF of a Drawing.

    Full info on the API and various language support is at https://dev-portal.onshape.com/

    Note the API info link is the word "here" on the above page which can be easy to miss...



  • thales_maiathales_maia Member Posts: 5 EDU
    Thanks. I see that is not a trivial task.
Sign In or Register to comment.