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.

query bodies created by boolean?

adamohernadamohern Member, OS Professional Posts: 216 PRO
If a boolean subtract splits one body in two, how can I query those bodies to delete one of them?

Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    edited April 2016
    One way would be to query for the new faces, edges, etc., and the query for their owner bodies. So something like
     qOwnerBody(qCreatedBy(id + "boolean"))

    Naturally this will fail if the boolean was a noop... I believe the identity also propagates past the boolean, so if you have a qCreatedBy(..., EntityType.BODY) which found the target before the subtraction, it should find the resulting bodies after the subtraction.
  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    Great, thanks. I had the right idea, but this is much more elegant code than I had in mind.
Sign In or Register to comment.