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: BOOLEAN_SAME_INPUT error message
CAD_SSP
Member Posts: 45 ✭✭
I am trying to create 2 holes in the same body using an adaption of the featurescript from "Dowel and Minifix", I can create and subtract the first hole and create the cylinder for the second hole but when I try to subtract that I get the error "@opBoolean: BOOLEAN_SAME_INPUT".
My code is as follows:
My code is as follows:
<div> // Create Hole cylinder geometry </div><div> fCylinder(context, id + THstr, { "bottomCenter" : THBot1, "topCenter" : THTop1, "radius" : TH_RADIUS });</div><div> </div><div> // Subtract Hole Geometry from all other bodies to create holes. </div><div> opBoolean(context, id + THbooleanstr, { tools : qCreatedBy(id + THstr, EntityType.BODY), targets : everythingelse, operationType : BooleanOperationType.SUBTRACTION });</div><div> //Update ID Strings </div><div> THstr ~= 1; </div><div> THbooleanstr ~= 1;</div><div> </div><div> // Create 2nd Hole cylinder geometry </div><div> fCylinder(context, id + THstr, { "bottomCenter" : THBot2, "topCenter" : THTop2, "radius" : TH_RADIUS });</div><div> </div><div> //Works fine up to this point </div><div> // Subtract Hole Geometry from all other bodies to create holes. </div><div> opBoolean(context, id + THbooleanstr, { tools : qCreatedBy(id + THstr, EntityType.BODY), targets : everythingelse, operationType : BooleanOperationType.SUBTRACTION });</div>
I have tried googling the error but no results.
If there is a way to subtract multiple bodies that would be even more useful!
Thanks in advance for any help.
If there is a way to subtract multiple bodies that would be even more useful!
Thanks in advance for any help.
0
Best Answer
-
NeilCooke Moderator, Onshape Employees Posts: 5,714Without testing I don’t know what is causing the error, but you can use qUnion for the tools argument and subtract both in one operation.Senior Director, Technical Services, EMEAI5
Answers
"everythingelse" is created by subtracting a created hole cylinder from literally everything else so I had to update that to be the new hole cylinder I had just created and it worked fine.
added...
as follows:
Your qUnion suggestion is a good one so will try that.
EDIT: correction - your code is fine since your first statement is just constructing the query not executing it (which is done in opBoolean). Sorry!