Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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?

Rhett_RobinsonRhett_Robinson Member Posts: 130 PRO

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.

Answers

  • Caden_ArmstrongCaden_Armstrong Member Posts: 195 PRO
    edited December 21

    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 Applications
Sign In or Register to comment.