Comments (12)
Thanks!
Could you let me know how exactly you would download STEPs/ShadedViews of a part (not partstudio) if it worked (using the python client)?
I also asked about downloading drawings. Is that currently working? If so, could you please also tell me how to download a drawing based on document-id, version-id and element-id of an onshape-app/drawing element? I'm using drawings_api.translate_format4 which doesn't seem to work as I would expect.
I would appreciate any help, thanks!
from onshape-clients.
Hello,
I can download STEPS from the blob directly with that call:
https://cad-euw1.onshape.com:443/modelexport?workspaceId=1bcea4f3b9786f5e23662c06µversion=ae91d6fe700e03305522a167&format=STL&mode=binary&grouping=true&scale=1.0&units=inch&_m=240af4f7&documentId=63d990e2dbf26fc0cff94e1c&elementId=628bdce768301ed4c26f20a3
This also works changing mode=text
I have no tried to download drawings.
I could upload the step using the online application. But my problem is that I can't upload any step using the API
from onshape-clients.
This is fixed... see this test, for instance: https://github.com/onshape-public/onshape-clients/blob/master/python/test/test_export.py#L6
from onshape-clients.
from onshape-clients.
from onshape-clients.
from onshape-clients.
Hi Victor,
The client code looks like it still needs a little tweaking in what it expects for the response. I'm working on that, but in the meantime, you can just pass in _preload_content=False to the endpoint call and the client won't attempt to deserialize the response. Also, as for the 'unverified' warning, that is just saying urlib doesn't have a mechanism to verify the ssl request, and you need to install one by doing something like this: https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl
from onshape-clients.
Ok Ethan, thank you. The first issue is solved with in _preload_content=False. But for the second one I've been trying https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl. But I don't know how to apply it to the client library. Do I have to modify the source code of the library? or can I set any static or singleton parameter to enable that mechanism of verification? Is it posible to disable it too? The problem is that I don't know where do I have to apply this in the client code: urllib3.PoolManager(cert_reqs='CERT_REQUIRED',ca_certs=certifi.where())
from onshape-clients.
Hello Ethan, with the first examples of api calls that I downloaded from Git hub it was so easy to connect. Now, since I am using the onshape_clientes 0.36, everything becomes more difficult, and I can not reuse the tests that I did before. The problem that I have now is that I can't create a new document. The client asks me for a parameter: BTDocumentParameters(). I've trying to initialize BTDocumentParameters with no arguments, as I have seen in DocumentsApi.md:
bt_document_params = BTDocumentParams()
api_response = Client.get_client().documents_api.create_document(bt_document_params)
but I get this invalid empty argument error:
File "/Users/woocomerce/repos/proto-data-batch/venv/lib/python3.7/site-packages/onshape_client-0.0.36-py3.7.egg/onshape_client/oas/rest.py", line 268, in request
raise ApiException(http_resp=r)
onshape_client.oas.exceptions.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Server': 'nginx', 'Date': 'Wed, 11 Mar 2020 18:20:12 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '97', 'Connection': 'keep-alive', 'On-Version': '1.110.25036.822859bf4713', 'On-Request-Id': '5d9066b22a9efc3d52a4b910', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block'})
HTTP response body: {
"moreInfoUrl" : "",
"message" : "Invalid empty argument.",
"status" : 400,
"code" : 0
}
The only think that I need is to create a new document. Please, can you tell me what is the missing parameter the I am not writing for BTDocumentParams?
Thank you
from onshape-clients.
done:
with those parameters por BTDocumentPArams:
bt_document_params=BTDocumentParams(
owner_type=0,
name="filename",
is_public=True
)
from onshape-clients.
You can request SSL certification through the configuration object: https://github.com/onshape-public/onshape-clients/blob/master/python/onshape_client/oas/rest.py#L64 . And that is actually set by default here to false: https://github.com/onshape-public/onshape-clients/blob/master/python/onshape_client/client.py#L198 . So for right now, you can't override that setting. I'll put that on the list of things to change for the next version. Thanks for pointing this out! For now, are you OK with making the unverified requests?
from onshape-clients.
yes, ok
from onshape-clients.
Related Issues (20)
- get_documents fails with BTGlobalTreeNodeInfo has no key 'defaultElementId' HOT 4
- Improve starting documentation HOT 1
- Strange behavior for PDF translations created via the API HOT 4
- test(Go): Handle 409 (Conflict) Response status while creating a document
- Noob - GET works, POST does not HOT 3
- [Python] PartApi: Export STL missing HOT 1
- GET with +ids not working
- Assembly.get_features returns 406 HOT 1
- Generate code for Go client doesn't exactly match the code from this repository
- Metadata Get methods are missing the data response description in openapi.json HOT 3
- Please publish python docs
- body_type case mismatch in Python API HOT 2
- Issues with the GOLANG Onshape APIs
- part_studios_api.eval_feature_script 400s with JSON error when using queries
- "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 47: invalid continuation byte" when trying to download obj from /api/documents/d/did/externaldata/fid HOT 1
- All python's examples contains broken code with contextmanager
- dd
- [TypeScript-Node] Please Publish API Docs
- [TypeScript-Node] HTTP 404 on the /api/endpoints Route?
- The typescript-node clients appear to be dependent on a deprecated package - request HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onshape-clients.