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.

Issue with Exporting GLTF Format Using RollbackBarIndex in Onshape API

pu_lipu_li Member Posts: 4

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:

  1. I set the rollbackBarIndex parameter in my API request, expecting to export the model as it appears at that specific index.
  2. However, regardless of the rollbackBarIndex value, the output GLTF file always shows the full, unrolled-back model.
  3. 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

  • Paul_J_PremakumarPaul_J_Premakumar Member, Onshape Employees Posts: 214
    edited May 28
    @pu_li,

       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 :


    body params
    {

    "allowFaultyParts": false,

    "angularTolerance": 0.001,

    "distanceTolerance": 0.01,

    "formatName": "GLTF",

    "maximumChordLength": 0.01,

    "resolution": "fine",

    "useGltfCompression": false

    }

  • pu_lipu_li Member Posts: 4
    @Paul_J_Premakumar

    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:

    1. The endpoint exportPartStudioGltf, even with the rollbackBarIndex parameter included, doesn't actually function as this parameter should.
    2. Utilizing updateRollback together with createPartStudioTranslation 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.

  • Paul_J_PremakumarPaul_J_Premakumar Member, Onshape Employees Posts: 214
    @pu_li

     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
Sign In or Register to comment.