onshape-public / onshape-clients

All Onshape clients for interacting with the Onshape API.
MIT License
34 stars 29 forks source link

Strange behavior for PDF translations created via the API #30

Open connorworley opened 4 years ago

connorworley commented 4 years ago

I'm running into a strange issue when I try to create PDF translations of drawings using the API.

Drawings through the browser look fine: browser.pdf But drawings through the API have missing views: api.pdf

Here's my code to generate the drawing through the API.

I've inspected the request that my browser makes when exporting a drawing, and the request the Python client makes by setting onshape_client.client.Client.get_client().configuration.debug = True.

After some experimentation, it looks like the PDF only comes out normal when certain headers in the browser request are present.

Is this expected behavior? Any possible workarounds?

eak24 commented 4 years ago

Does this drawing have linked documents in it? You might need to pass in the LinkDocumentId and the LinkDocumentWorkspaceId. I'm guessing this has something to do with how the missing parts are pulled in. Let me know what you find!

connorworley commented 4 years ago

I don't think I have linked documents (my Onshape experience is very limited). Here's what I'm working with: https://cad.onshape.com/documents/c7d69482982a4c651d6d46f9/w/5ffe3a8df402271b05556d03/e/a3fb83a45863d8b3a5c10c86

tabearasa commented 3 years ago

Has there been a solution to the problem in the meantime?

connorworley commented 2 years ago

I just tested this again and the drawing now seems to be correct. If anyone can repro then I can close this issue.