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.

delete a sketch

adamohernadamohern Member, OS Professional Posts: 216 PRO
If I create a sketch using newSketchOnPlane(), how do I delete it?

Comments

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,026
    You can use opDeleteBodies and pass a qCreatedBy(id + "whateverYourSketchIdIs") query to it
    Ilya Baran \ Director, Architecture and FeatureScript \ Onshape Inc
  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    Ah, looks like opDeleteBodies() will do the trick. It seems semantically odd that sketches would be considered bodies, but I guess it makes sense. False alarm.
  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    You can use opDeleteBodies and pass a qCreatedBy(id + "whateverYourSketchIdIs") query to it
    Wow you're fast.
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 521
    adamohern said:
    It seems semantically odd that sketches would be considered bodies
    "Body" has a specific meaning in Onshape which includes any full, independent piece of geometry in a Part Studio, including the wire bodies in sketches. Check out the documentation for BodyType to see what I mean.
  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    It's just strange nomenclature is all. It's perfectly fine in terms of functionality, I guess I would just expect that class of object to be called an "object" or something. The word "body" in my mind usually does not include one-dimensional or two-dimensional geometry. It's fine, I just didn't find it intuitive.
Sign In or Register to comment.