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.

API - export part studio?

vanowmvanowm Member Posts: 81 ✭✭

Hello.

I'm trying to create a one-click export current state of a part studio using API and extract downloaded file.

So far it kind of works: it downloads zip file and extracts it, however the downloaded model is not the same as in part studio, because of the configuration (I'm using this document for my tests):

  1. how do I get current configuration? When using https://cad.onshape.com/glassworks/explorer/#/Element/getConfiguration
     it pulls only the "default" values, not what currently is set in the part studio
  2. using https://cad.onshape.com/glassworks/explorer/#/PartStudio/createPartStudioTranslation
     with these parameters:
    {"formatName": "STL",  "stlMode": "BINARY",
      "grouping": false,  "storeInDocument": false,  "unit": "MILLIMETER",  "resolution": "FINE",  "configuration": "List_ZtPTSWsj4qojhC=_2;top=10mm;bottom=20mm;linked=false"}

    seems to be ignoring unit and resolution parameters. The stl exported in meter, with very low resolution (definitely not FINE).
  3. Is there a way get settings from export dialog?
    image.png

Or maybe there is already existing code for this?

Thank you.

P.S.

The API is extremely difficult to understand, where can I find information what each parameter for each API means and what expected values? Or what permissions each API feature required?

For instance, the translation evidently requires both document read and write permissions, I couldn't find where it says so…took me half a day to figure out why I was getting 403 error with just document read permission.

Or when using API explorer with default parameters it returns 404 error, because provided values are not what it's expecting…seriously?

Sign In or Register to comment.