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.
Simple C++ onshape STL export
billyzelsnack
Member Posts: 84 PRO
I have written a minimal c++ example for exporting STL files from a partstudio that supports both API Keys and OAuth authorization. I am not a web developer and I found the onshape-public examples extremely confusing to follow. I ended up writing this from scratch from the documentation instead. It's available here: https://github.com/billyzelsnack/simple_onshape_exportstls
0
Comments
I generate a list of partId via the /parts call as before
Side note. Am I missing something that the Glassworks API Explorer can't actually test the stl calls because it needs to do a redirect?
I can take a copy/paste a string from the API Explorer and stick it into my code that does the redirect and get an stl back of the entire model. This is that call:
However, if I copy/paste from the API Explorer and enter (one or more) partId (that my /parts call gave me). Like this call:
I get this redirect:
Which does not give me an stl, but this:
For example these two calls will give me stls for the two different parts:
However if I try a list as described in explorer (why I thought that I needed the partId= to begin with) I just get the error from above.
Here is the relevant section from API Explorer: