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.

Gotcha! opDeleteBodies on an unused sketch

blackslateblackslate Member Posts: 16
I'm just new here, making creative beginner's mistakes, so this is probably something you all already know, but it seems unintuitive to me.

You must sketch something in a sketch and then skSolve the sketch before you can use opDeleteBodies to delete it.

If you don't, you get a CANNOT_RESOLVE_ENTITIES error, which, for a beginner, doesn't explain too much.




Comments

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,680
    The sketch geometry doesn't exist until it is solved that's why you can't reference it. 
    Senior Director, Technical Services, EMEAI
  • Jacob_CorderJacob_Corder Member Posts: 137 PRO
    before calling opDeleteBodies, i always check if the delete query is not empty if I don't know or if it is possible that their are not any bodies to delete .
    if(isQueryEmpty(context, qCreatedBy(someId,EntityType.BODY))==false)
    {
    now delete it. 
    }
Sign In or Register to comment.