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.
opBoolean targets from array of queries
Hi,
I have code of the form below.
A number of faces are selected, sketches are drawn on the first and last face and then a loft is executed between those sketch regions.
The lofted part then needs to cut through all bodies (start, all intermediate and end) which are owners of the selected faces.
I'm building an array of qOwnerBody(face) but qUnion in opBoolean fails when passing that array of bodies.
How should I actually go about gathering all of the owing bodies to be cut?
annotation { "Name" : "Faces", "Filter" : EntityType.FACE }
definition.faces is Query;
opLoft(context, id + "loft1", { "profileSubqueries" : [qSketchRegion(id + "startSketch"), qSketchRegion(id + "endSketch")], }); var bodies is array = []; for (var face in evaluateQuery(context, faces)) { bodies = append(bodies, qOwnerBody(face)); } opBoolean(context, id + "boolean1", { "tools" : qCreatedBy(id + "loft1", EntityType.BODY), "operationType" : BooleanOperationType.SUBTRACTION, "targets" : qUnion(bodies, qOwnerBody(anotherFace)), "keepTools" : true });
Any help appreciated.
Thank you.
Best Answer
-
graham_lock Member Posts: 142 PRO
Just realised that qOwnerBody can take the faces query in my example so solved!
0
Answers
Just realised that qOwnerBody can take the faces query in my example so solved!