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.

opSplitEdges() on sketch geometry?

Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
edited February 2023 in FeatureScript
I'm trying to make a feature that will take some sketch inputs, and modify them. As part of the process, I'd like to trim away some parts of the original curves. I tried opSplitEdges(), which does split the curve, but the result isn't quite what I'm looking for. After seeing @S1mon post about HTML tables I thought I'd give that a go too. Here's the example document. Any tips?

What it does What I want
is no longer sketch geometry, which means it no longer has a plane with a direction (Extrude can't handle it, for example). become part of a new sketch made by my feature, which also has some new curves added.
Deletes the curve from the original sketch. Leave it alone (maybe I could copy it and split the copy?)
The new curves don't have selectable endpoints. I want it to feel just like sketch geometry. My best idea so far is to use evApproximateBSplineCurve() then use the points from that to re-create the curve in the sketch, but that has its own problems, like the fact that there is only a sketch bezier, not a b-spline. It feels pretty roundabout anyway. 
Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io

Best Answer

  • chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 130 PRO
    Answer ✓
    I know the goal is sketch geometry, but something I've found is that Onshape treats sketches created by custom features differently than how sketches are normally treated. For example, if you click the "Show/hide sketches" option in drawings it will not show sketches generated by custom features. 

    This probably doesn't solve the issue, but maybe this will offer some sort of jump off point. I have gotten into the habit of using opExtractWires(), which creates wire bodies from the sketch. That will have selectable endpoints, but unfortunately still doesn't let Extrude use those curves.
    Applications Developer at Premier Custom Built
    chadstoltzfus@premiercb.com

Answers

  • chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 130 PRO
    Answer ✓
    I know the goal is sketch geometry, but something I've found is that Onshape treats sketches created by custom features differently than how sketches are normally treated. For example, if you click the "Show/hide sketches" option in drawings it will not show sketches generated by custom features. 

    This probably doesn't solve the issue, but maybe this will offer some sort of jump off point. I have gotten into the habit of using opExtractWires(), which creates wire bodies from the sketch. That will have selectable endpoints, but unfortunately still doesn't let Extrude use those curves.
    Applications Developer at Premier Custom Built
    chadstoltzfus@premiercb.com
Sign In or Register to comment.