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.
Featurescript to add heat-set threaded inserts
david_riedell
Member Posts: 23 ✭✭
I use a lot of M3 heat-set threaded inserts in my 3Dprints but it takes several hole operations to generate the type of geometry I need. I haven't really created a featurescript before, but I think this would be a good use-case to simplify my workflow.
What I'd like is to be able to specify a somewhat complicated hole type and select multiple points to apply it to. I'm usually attaching an acrylic sheet on top of a 3d printed part, like in the picture below.
I need a counterbore in the acrylic, then a 3.4mm clearance hole for the M3 screw. I'd like to be able to specify the counterbore depth as well as the hole depth.
I also need a 4.5mm hole that starts at the top of the 3D printed part, with a small countersink to give the plastic somewhere to go when it becomes molten during the insertion.
Like I said I haven't done a lot with featurescript before, can someone give me some pointers on how to go about making this?
What I'd like is to be able to specify a somewhat complicated hole type and select multiple points to apply it to. I'm usually attaching an acrylic sheet on top of a 3d printed part, like in the picture below.
I need a counterbore in the acrylic, then a 3.4mm clearance hole for the M3 screw. I'd like to be able to specify the counterbore depth as well as the hole depth.
I also need a 4.5mm hole that starts at the top of the 3D printed part, with a small countersink to give the plastic somewhere to go when it becomes molten during the insertion.
Like I said I haven't done a lot with featurescript before, can someone give me some pointers on how to go about making this?
Tagged:
0
Best Answer
-
eric_pesty Member Posts: 1,836 PROOne way to do this would be to create a solid representing the volume you want. Then you could potentially just use the "super derive" feature to place as many of these as you want in your model as a "remove".
To turn this into a featurescript would be pretty similar, you could us a different solid to "import" for the different size and place your solids wherever you want and then boolean them out of the target parts.2
Answers
Probably the correct way is to extrude multiple cylinders of different diameters.
I'm able to follow it so far but the headRegion and screwRegion code is throwing me off. Is there a way to select sketch regions based on the circleId i.e. screwProfile and headProfile instead of doing a qSubtraction?
- qSketchRegion(sketchId, false) gets the full region enclosed by the bigger circle.
- qSubtraction(qSketchRegion(sketchId, false), qSketchRegion(sketchId, true)) gets the inner region.
This only really works for the case of one region contained in another. We don't normally do more complex cases. I think, if you've got a sketch with more regions than that, you've got two options:
1. Use qContainsPoint (I haven't tested this) and feed in a point you know lies only in a specific region.
2. Just make multiple sketches and extrude them separately to avoid all of this. I think that would be the easiest approach.
Regardless, protip: debug(context, myQuery) is an invaluable tool for testing your feature.
To turn this into a featurescript would be pretty similar, you could us a different solid to "import" for the different size and place your solids wherever you want and then boolean them out of the target parts.
Ok that's way easier, I didn't know "super derive" was a thing. I'll probably go back and work on my featurescript more later but this'll work for now. Thanks.
I believe this macro, Custom Cuts, fits perfectly with what you're looking for.
You can see here https://www.c2i.es/slides/macros-featurescript-para-onshape-1355 the complete collection of macros included, along with many other tools and our technical support, in the Onshape C2i Business program.
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común