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.
Configuration variables lead to the error: onshape_client.oas.exceptions.ApiException: (404)
tanja_matzerath
Member Posts: 9 EDU
Hello everyone,
I get the following error message when I try to export an stl-file with the onshape-client:
onshape_client.oas.exceptions.ApiException: (404)
Reason: Not found
This error only occurs if the configuration variables have values that differ from the defined default value. There are 5 different configuration variables in the PartStudio. If the first four deviate from the default value but are still in the definition range, the error occurs. The fifth configuration variable can also have a different value than the default value and the export works. However, not every value can be used for the fifth variable either.
If I change the variables in the browser and export the stl file itself, there is no problem at all. So this means that the values that the configuration variables should take do not cause an error in PartStudio.
I don't understand why I can't export the stl file via the onshape client as soon as the configuration variables differ from the default value.
Can anyone help me in this matter?
Many thanks in advance
I get the following error message when I try to export an stl-file with the onshape-client:
onshape_client.oas.exceptions.ApiException: (404)
Reason: Not found
This error only occurs if the configuration variables have values that differ from the defined default value. There are 5 different configuration variables in the PartStudio. If the first four deviate from the default value but are still in the definition range, the error occurs. The fifth configuration variable can also have a different value than the default value and the export works. However, not every value can be used for the fifth variable either.
If I change the variables in the browser and export the stl file itself, there is no problem at all. So this means that the values that the configuration variables should take do not cause an error in PartStudio.
I don't understand why I can't export the stl file via the onshape client as soon as the configuration variables differ from the default value.
Can anyone help me in this matter?
Many thanks in advance
0
Comments
As @pmd said, it's always a good idea to understand exactly how the API call is formatted in https://cad.onshape.com/glassworks/explorer before trying it in your own code.
To extract the stl files, I created the function "exportSTL" as described here: https://colab.research.google.com/github/PTC-Education/PTC-API-Playground/blob/main/Onshape_API_Snippets.ipynb#scrollTo=Ql6qSU3pzWEC .
The different variables I use are listed in the params dictionary with an entry called:
configuration = {
'units': 'meter',
'scale': 1.0,
'configuration' :
'alpha=35+deg;'
Could the problem be related to the PartStudio itself? Could it be that I have inadvertently checked a box somewhere?
Custom FeatureScript and Onshape Integrated Applications
Thank you for your reply. This is the URL of the partStudio:
https://cad.onshape.com/documents/50287f5bd939f1fc9c56b045/w/250ef840f8e7c389efbfb934/e/950aab39e9373cac7e44712e?configuration=angleThreadMain=0.08726646259971647+radian;angleThreadSubdeg=0.7853981633974483+radian;length=1.0;numberThreadMain=1.0;numberThreadSub=8.0&renderMode=0&uiState=65f00acf73caa02e9a7ff55b
Not the URL of the part studio, the request URL that is sent to the Onshape api.
Your API call could be the issue, knowing what you are actually sending to the API will help in the debugging process.
Ie, the url sent in the format of:
cad.onshape.com/api/partstudios/..../stl
Custom FeatureScript and Onshape Integrated Applications
Try clicking the link below (or sending it to the API)
https://cad.onshape.com/api/partstudios/d/50287f5bd939f1fc9c56b045/w/250ef840f8e7c389efbfb934/e/950aab39e9373cac7e44712e/stl
It should download the file.
Custom FeatureScript and Onshape Integrated Applications