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.
Exporting Assemblies to Collada via the REST API?
Doug_Stephen
Member Posts: 7 PRO
As the title says, I'm curious if this is possible. I've been playing with the REST API Explorer for a few days now, and I can't seem to find what I'm looking for but as the documentation is a little sparse I'm just not sure if it's something I've missed.
Our use-case is that we are using OnShape to develop models for robots, which would then have their physical properties and graphical meshes exported out so that we can use these models in dynamics simulations like Gazebo or our own in-house simulation software.
I've found where it's possible to export .STL files from Part Studios, but this falls a little short. STL loses some of the material properties that we care about and Part Studios are too granular; some of our meshes are assemblies that don't necessarily have articulation but are built up from several separate parts.
Is this something that's possible or at the least on the road map?
Thanks for taking a look at this!
Our use-case is that we are using OnShape to develop models for robots, which would then have their physical properties and graphical meshes exported out so that we can use these models in dynamics simulations like Gazebo or our own in-house simulation software.
I've found where it's possible to export .STL files from Part Studios, but this falls a little short. STL loses some of the material properties that we care about and Part Studios are too granular; some of our meshes are assemblies that don't necessarily have articulation but are built up from several separate parts.
Is this something that's possible or at the least on the road map?
Thanks for taking a look at this!
Tagged:
1
Best Answer
-
mthiesmeyer Onshape Employees Posts: 115Hi @Doug_Stephen,
Any formats that can be exported through the UI should also be exportable through the API. See below for what you should be looking for in the API Explorer.
Assemblies/PartStudios -> Get Translation Formats
Will return the list of formats that we support for assemblies and part studios. Note that although this request takes an elementId, at this point all elements of the same type will have the same export formats available.
Assemblies -> Create Assembly translation / PartStudios -> Create Part Studio translation
This will initiate the actual translation, which may not be finished when you receive the response. If the requestState is ACTIVE you should poll the href (Translations -> Get Translation Status) returned in the response (with a delay between each request) until the requestState returned is DONE or FAILED.
If the translation did not fail, you can then use the resultExternalDataIds field from the response in conjunction with Documents -> Download External Data to retrieve the data created by your translation request.
Please let me know if you have any questions.
Best,
Mike
5
Answers
Any formats that can be exported through the UI should also be exportable through the API. See below for what you should be looking for in the API Explorer.
Assemblies/PartStudios -> Get Translation Formats
Will return the list of formats that we support for assemblies and part studios. Note that although this request takes an elementId, at this point all elements of the same type will have the same export formats available.
Assemblies -> Create Assembly translation / PartStudios -> Create Part Studio translation
This will initiate the actual translation, which may not be finished when you receive the response. If the requestState is ACTIVE you should poll the href (Translations -> Get Translation Status) returned in the response (with a delay between each request) until the requestState returned is DONE or FAILED.
If the translation did not fail, you can then use the resultExternalDataIds field from the response in conjunction with Documents -> Download External Data to retrieve the data created by your translation request.
Please let me know if you have any questions.
Best,
Mike
Not sure if this is me doing something wrong or if there's a hiccup with the Java bindings but I'll keep playing with it and I'll update this post as I learn more.
Quick edit, I *am* able to get to the Collada file if I use the API Explorer from the web app, using the same DID and FID that I'm trying to use from the Java library. So it seems like this may be a bug in the Java library.
Sorry about that. I have taken the liberty of filing an issue with the java-client library for you, you can find it here. Please feel free to add any additional information!
Best,
Mike