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.
Getting thumbnails and shaded views through API problem
shawn_crocker
Member, OS Professional Posts: 865 PRO
in General
I am able to call a shaded view for a document successfully. Problem is, depending on what item is being referenced, it may not be fitting into the image border and is just getting chopped off. Is there some way to change that behavior that I am not seeing in the Doc's? Another problem. I have tried getting thumbnails but thumbnail does not exist gets returned. I have also tried posting to create a thumbnail for the item but also am getting an error "Could not get element information". Anyone know what maybe wrong here. I am testing this using glassworks. The same id's have been working fine when testing out other end points.
Tagged:
0
Best Answer
-
caden_armstrong2 Member, User Group Leader Posts: 127 ✭✭✭Could you provide samples of your API calls?
How are you setting the view matrix for shaded views?
How are you trying to get the thumbnail?
If you call the basic /api/thumbnails/d/{did} you should see a list of valid thumbnail hrefs.
If you call a size that doesn't exist, you'll get an error.0
Answers
How are you setting the view matrix for shaded views?
How are you trying to get the thumbnail?
If you call the basic /api/thumbnails/d/{did} you should see a list of valid thumbnail hrefs.
If you call a size that doesn't exist, you'll get an error.
My guess would be that they get added in the order that they are created, and thumbnails are only made as they are needed.
You'll probably have to check the list by the size parameter for what you want, but then if it doesn't exist, do the post command to make the thumbnail exist.
You likely won't be able to guarantee that the size you want exists.
Thanks. I have managed to script a little transform to always pull out the size I want from the array regardless of its index in the array.