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.
Can I make my feature error out if the tools and targets do not intersect for a boolean subtract?
I basically want this message to be generated as well as my feature to error out if the boolean subtract does not create a change in geometry.
Here is what I have so far, but I am not sure if this is the right way to go about it. The standard boolean feature will show this error message but still complete (no red in the tree), but I'm wondering if I could make that happen too. Otherwise the message will suffice.
Best Answer
-
Caden_Armstrong Member Posts: 216 PRO
You could just check if any geometry has been created by the operation.
if(isQueryEmpty(context, qCreatedBy(id + "boolean1"))) { reportFeatureWarning(context, id, "NON-INTERSECT"); }
www.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications2
Answers
You could just check if any geometry has been created by the operation.
Custom FeatureScript and Onshape Integrated Applications
Wow, that is even easier. Thanks!