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.
translation including all pages in a drawing from API
shawn_crocker
Member, OS Professional Posts: 859 PRO
For the time being, I need to use an image format when doing my drawing translation through the api. I am noticing that only the first sheet is being translated. This makes sense being an image file. I am not able to figure out how to create a translation of the other pages. I'm thinking there must be a way to loop through the available sheets and create a translation for each one? I see the parameter sheetIndices[] and I am not sure if that is what I need to use some how. I also do not know how to query the drawing to see how many sheets it contains. This doesn't seem to be included in a metadata call.
Tagged:
1
Answers
I did. Thanks for asking. It was clarified to me that we cannot translate all the sheets when using an image format translation. So, I have just switched to using the .pdf option. We have an app that creates a MFG package of all the info needed to build a certain product. The app sends everything to a template api to generate a printable report. I need to send the drawings as images for them to be added into the report. I have just implemented another file conversion api that converts the .pdf sheets to individual .png images and then I use those in the template api. I actually like it better because we then get to file away a proper .pdf drawing which is nice when needed to access the drawing on the fly without having to wait for the onshape doc to load. I am using convertAPI for this file conversion. It works very good and returns an array of the sheet images in .base64 which I then upload into our file system along with the base64 pdf. If I restarted, I would probably use cloudConvert. I think it is a little cheaper and it looks like you can connect it directly to your file system and have the conversion directly dropped in.