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.
Is there an API endpoint for checking interference between two parts?
md_al_mamun316
Member Posts: 13 EDU
I am using onshape through API request and I have a question regarding Interence check functionality.
For UI, we have interence check option in both Assembly studio and Part studio, but I cannot find the enpoint that does the same functionality.
Can someone help me to locate the endpoint that checks the interence of two parts?
Thanks in advance.
Tagged:
0
Answers
I'm not sure this is possible. @caden_armstrong will know.
The only way I know of currently is to use a custom feature like this:
https://forum.onshape.com/discussion/comment/45646/#Comment_45646
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! cadsharp.com/featurescripts 💎
You can do it with a featurescript and call the featurescript via the API, but this only works inside of a part studio.
Thanks for the answer. I still have follow-up questions.
- If I look at the request body, it is not clear to me. Can you explain me how I should send the request? Should I fill the part_ids in "additionalProp1" field as a list? Below I included the request body.
- If I look at the response as well, I also don't know which parameter is indicating interference. Can you point-out parameter indicating interfence in the response?
Thanks a lot.I am new to onshape and still learning a lot. I think you can ingnore my previous question as I have undestood Feature Script and Feature Studio. First I need to create a featurescript that checks the interference of given two parts then make API call to the featurescript. That is clear.
However, I still have one problem.
I have tried to create my featurescript for interference check but I am stuck after I got the part Ids as a precondition. There is interference function but I don't know how to use it. I hope you can help me on this one. Thanks in advance.
You can see my featurescript below:
I'm not sure interference() is an op that is available. In your code you are trying to call your own feature into it's own definition. This course should get you started with FeatureScript: Learning Center - FeatureScript
Try evCollision() instead of interference().
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! cadsharp.com/featurescripts 💎
My custom Collision feature works on UI. Here is the script:
It works as I have checked it with script notices.
Now, my real question was to do it through API calls. I am testing it on API explorer (https://cad.onshape.com/glassworks/explorer#/ ). Here is request body that I am sending for featurescript POST endpoint:
This also works as I get the following response:
However, when I do it using onshape_client package on Python it doesn't work. Here is my code:
I got the following error:
Can you help me on this? @caden_armstrong @MichaelPascoe
I'm not sure on this one.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! cadsharp.com/featurescripts 💎
Caden is the best API guy I know. I stick to FeatureScript. If you are setting this up for your company, then I suggest having CADSharp do it. If this is for research or a personal project, try the resource below.
Here is a neat API resource I noticed the other day: https://forum.onshape.com/discussion/19547/app-to-help-with-app-development#latest
Sounds like it will be perfect for what you are trying to do. Contact @Aaron_Magnin to get in on the beta.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! cadsharp.com/featurescripts 💎
Thanks for the information.