Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

skRectangle error when part's rotated

Lee_HeskethLee_Hesketh Member, Developers Posts: 148 ✭✭✭
Hi there. I have a script that generates mortice and tenon joinery however I have some problems. It works fine if the parts face that the tenon protrudes from is aligned with the x axis. The problem is when it aligns with the y axis.

How I have got it to work so far is the user selects two adjacent faces and then the adjacent face to those two is found using queries. then the vertex of one of the corners is found which is used as the first corner of an skRectangle() function. The other corner is vector(-width, -height). Where width and height are variables chosen by the user.

When it aligns with the y axis, the width and height become swapped and I don't know how to deduce which way the face is aligned. Here is the document. Could anyone have a look and see where I am going wrong? It's feature studio 2.

https://cad.onshape.com/documents/580b256ade95e210af0261d8/w/1d22e17d9b07548059b7b311/e/119330903d9f0efa384481b9

Thanks
Lee Hesketh

There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!

Best Answer

Answers

Sign In or Register to comment.