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.
FS Hole example
cory_isaacson
Member, Developers Posts: 43 PRO
The documentation is incomplete for the hole feature, is there an example of how to drill a hole in a part? Looking at the hole.fs source, it's not obvious how to do it either.
Tagged:
0
Best Answer
-
cory_isaacson
Member, Developers Posts: 43 PRO
I worked out how to do this, I just added the holes to the original sketch and ignored the nested areas during the extrude, then the holes were all there. Your suggestion would have worked too.
0
Answers
Here are some of the things I tried (you can see options in comments).
// Perform boolean operation to remove the cylinders, leaving the holes.<br> var cylinderQuery is Query = qContainsPoint(qCreatedBy(id + "holesExtrude1", EntityType.BODY), vector(upperHoleCenter[0], upperHoleCenter[1],0 * inch));<br> logMessage(context, debugFlag, "cylinderQuery", cylinderQuery);<br> <br> // // Build a query based on all value.extrudeNames, which will return all layers.<br> // var layerQueryArray is array = makeArray(value.numberOfParts);<br> <br> // for(var j=0;j<value.numberOfParts;j+=1)<br> // {<br> // layerQueryArray[j] = qCreatedBy(id + value.extrudeNames[j]);<br> // }<br> <br> // var layersQuery is Query = qIntersection(layerQueryArray);<br> //var layersQuery is Query = qEdgeAdjacent(cylinderQuery, EntityType.BODY);<br> var layersQuery is Query = qCreatedBy(id + "extrude0", EntityType.BODY);<br> logMessage(context, debugFlag, "layersQuery", layersQuery);<br> <br> opBoolean(context, id + "extrude0" + "holesBoolean", {<br> "tools" : cylinderQuery,<br> "targets" : layersQuery,<br> "operationType" : BooleanOperationType.SUBTRACTION<br> });If you are only subtracting some, then you can use qUnion and qSubtraction to build lists of bodies you need to use.