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.

Translating drawing through API

shawn_crockershawn_crocker Member, OS Professional Posts: 637 PRO
I am wondering if there is a way to have a translation post request for a drawing only return results when the translation status is "DONE"?  For now, it seems I need to call the translation, and then I call the status of the translation and keep calling it in a loop until the status is "DONE".  Then I use the id from that status call to call out a stream of the file.  This would be a lot simpler if the initial translation call waited to return results until the translation was "DONE".
Tagged:

Best Answer

  • caden_armstrongcaden_armstrong Member, User Group Leader Posts: 82 PRO
    Answer ✓
    Because the translation endpoint is a bit of a catch all, there are scenarios where that wouldn't work.
    Sure a drawing is pretty quick to translate, but the same endpoint can be used to export a 1,000 part assembly in fine detail. A process like that would exceed the request timeout before finishing.

    It probably isn't what you want, but there is a way to register a webhook to receive a notification when a translation is complete.
    https://onshape-public.github.io/docs/translation/#webhook-translation-completion-notification
    Software Development Lead - CADSharp.com - Email
    We specialize in custom FeatureScripts, and Onshape integrated applications

Answers

  • caden_armstrongcaden_armstrong Member, User Group Leader Posts: 82 PRO
    Answer ✓
    Because the translation endpoint is a bit of a catch all, there are scenarios where that wouldn't work.
    Sure a drawing is pretty quick to translate, but the same endpoint can be used to export a 1,000 part assembly in fine detail. A process like that would exceed the request timeout before finishing.

    It probably isn't what you want, but there is a way to register a webhook to receive a notification when a translation is complete.
    https://onshape-public.github.io/docs/translation/#webhook-translation-completion-notification
    Software Development Lead - CADSharp.com - Email
    We specialize in custom FeatureScripts, and Onshape integrated applications
Sign In or Register to comment.