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.
How to export a part (not partstudio) as a STEP file using Onshape API

I'm writing a script to automate a bunch of exports and gather other part information and I was previously using the URL
"https://cad.onshape.com/api/v6/assemblies/d/{document_id}/w/{workspace_id}/e/{element_id}/translations"
but I realized after a bit that this exports the full part studio, as the URL only goes far enough to specify an element id, which would be the ID of the whole part studio the part is in. I found in the documentation a way to export parts as STL files with part ids, but cannot find any documentation or forums anywhere talking about exporting parts to STEP files. Here is the URL for exporting parts to STLs:
"https://cad.onshape.com/api/v6/parts/d/{document_id}/w/{workspace_id}/e/{element_id}/partid/{part_id}/STL?mode=text&grouping=true&scale=1&units=inch"
I tried modifying this to make it work for a STEP file and using this as the check_URL:
"https://cad.onshape.com/api/v8/translations/{request_id}"
but have had no luck. Has anybody successfully done a STEP file export via the API?
Thank you in advance!
Best Answer
-
Caden_Armstrong Member Posts: 224 PRO
If you look at the body for the partstudios translations endpoint, there is a field called: "partIds" which takes in a comma separated list of part IDs.
https://cad.onshape.com/glassworks/explorer/#/PartStudio/createPartStudioTranslationwww.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications1
Answers
If you look at the body for the partstudios translations endpoint, there is a field called: "partIds" which takes in a comma separated list of part IDs.
https://cad.onshape.com/glassworks/explorer/#/PartStudio/createPartStudioTranslation
Custom FeatureScript and Onshape Integrated Applications
thank you!
Thank you! This, along with specifying "onePartPerDoc": True solved my issue.