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.
Issue with Exporting GLTF Format Using RollbackBarIndex in Onshape API
I've encountered a problem while trying to export a model to GLTF format using the Onshape API. Despite setting the rollbackBarIndex
to various values, the exported GLTF file always represents the complete, final model rather than the expected state of the model rolled back to the specified index.
Here's a brief overview of what I'm doing:
- I set the
rollbackBarIndex
parameter in my API request, expecting to export the model as it appears at that specific index. - However, regardless of the
rollbackBarIndex
value, the output GLTF file always shows the full, unrolled-back model. - Additionally, all my testing was conducted on the Onshape Glassworks Explorer at https://cad.onshape.com/glassworks/explorer.
Has anyone faced a similar issue or can offer any insights into what might be going wrong? I'm looking for guidance on how to correctly use the rollbackBarIndex
to export a model at a specific state in its history.
Thank you for your help!
Answers
This is likely a limitation with the https://cad.onshape.com/glassworks/explorer#/PartStudio/exportPartStudioGltf endpoint. Can you file a ticket with support?
As a workaround you can use the general translations endpoint https://cad.onshape.com/glassworks/explorer#/PartStudio/createPartStudioTranslation , which respects the rollback bar. There are a couple of differences to note.
1. This endpoint, does not take a rollback index. However you can update the rollback bar position (manually or via the API: https://cad.onshape.com/glassworks/explorer#/PartStudio/updateRollback ) and then make the call.
2. The endpoint is asynchronous, and returns a URL whic
Here is a sample cUrl to make the glTF request :
Thank you very much for your prompt response! I must admit that I'm a beginner with a limited understanding of Onshape, so I'm not quite clear on what you mean by "file a ticket with support."
Based on your answer, may I understand it as follows:
exportPartStudioGltf
, even with therollbackBarIndex
parameter included, doesn't actually function as this parameter should.updateRollback
together withcreatePartStudioTranslation
could help me reach my ultimate goal.If my understanding is correct, I have another question: Can
updateRollback
be applied to public Onshape models, meaning those files I don't have direct editing rights to?I hope my lack of knowledge hasn't caused you too much trouble. Thank you once again for your answer.
Your understanding on #1 & #2 is correct. For public documents, if you do not have edit permission, you will not be able to update the rollback bar. You may have to copy the document and edit it.
To file a ticket with support, from within onshape, click the help menu-> contact support.
Hope that helps,
Paul