query bodies created by boolean?

adamohern
adamohern 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_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    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.
  • adamohern
    adamohern 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.