<p>Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.</p></p><strong>First time visiting? Here are some places to start:</strong></p><ol style="list-style:inherit;margin-left:25px;"><li>Looking for a certain topic? Check out the <a href="https://forum.onshape.com/categories">categories filter</a> or use Search (upper right).</li><li>Need support? <a href="https://forum.onshape.com/post/question/community-support">Ask a question</a> to our <a href="https://forum.onshape.com/categories/community-support">Community Support</a> category.</li><li>Please submit support tickets for bugs but you can request improvements in the <a href="https://forum.onshape.com/categories/product-feedback">Product Feedback category</a>.</li><li>Be respectful, on topic and if you see a problem, Flag it.</li></ol><p>If you would like to contact our Community Manager personally, feel free to <a href="https://forum.onshape.com/profile/6/LouGallo">send a private message</a> or <a href="mailto:lgallo@onshape.com">an email</a>.
</p>
</p>
Looping sketch creation with Extrude Cut or Boolean
Nath_McC
Member Posts: 136 PRO
Hi All,
I have a feature script for crate a broached hex, and I have three main issues, which I'm hoping I can get help on.
The link to the document is here: https://cad.onshape.com/documents/143d97f968e97efe61cf1d4f/w/86344877e8b059d820b296f3/e/7dd59a453a901190faf0a82a
I have a feature script for crate a broached hex, and I have three main issues, which I'm hoping I can get help on.
The link to the document is here: https://cad.onshape.com/documents/143d97f968e97efe61cf1d4f/w/86344877e8b059d820b296f3/e/7dd59a453a901190faf0a82a
- I am trying to have the extrude cut feature remove the hex, but it does not seem to work when using "operationType" : NewBodyOperationType.REMOVE: I'm unsure if this is correct or if I need to include a boolean subtraction operation. What is the best way to achieve the cut operation?
- If I select multiple points, I get an error; from troubleshooting, I think this is due to some issue with the //Create hex sketch. If I // out that section, the hole itself generates. Could somebody please look at my code and see where I am going wrong?
- The code below is on line 189 and removed the sketch for the drill hole, but if I copy it and replace id + "sketch" with id + "Hsketch", I hope to remove the hex/polygon sketch. Can I remove all the sketches in one operation at the end?
opDeleteBodies(context, id + "delete_sketch", { "entities" : qCreatedBy(id + "sketch", EntityType.BODY) }); Some of my code was taken from the ports feature script, but I can't figure out the last parts.
Any help would be greatly appreciated.
0
Comments
-
The most efficient way to do this would be to create a solid for the hole (using opRevolve), a solid for the hex (opExtrude), boolean together (opBoolean), get the transforms between all the hole points, pattern (opPattern), remove all from part (opBoolean), delete sketches. Therefore you only make 2 sketches and 2 booleans.Senior Director, Technical Services, EMEA1
-
Thank you @NeilCooke, I will try and give that a go.
0

