OP revolve constantly failing in onshape feature script

Matthew380
Matthew380 Member Posts: 50 ✭✭

So I was making a new script and tried to revolve an eclipse. However, no matter what I do, it always fails, and I am doing everything right. Can you help? Here is the document:

https://cad.onshape.com/documents/f675b5332c949ed5725fc647/w/20de1eb21e61b8e0246201b2/e/525f988c536d86c131f98129

Tagged:

Best Answer

Answers

  • jelte_steur_info
    jelte_steur_info Member Posts: 683 PRO

    the feature is giving the proper warning:

    image.png

    When you try to revolve a whole ellipse around its own center axis, its going to come around and interfere with itself. You can try this by modeling it manually first, the onshape native revolve feature will also not allow it.
    This is a tip in general: when you want to make a feature do what you'd normally do in multiple native onshape features. create a model manually first, to learn if that works at all. the tricks you apply there (like splitting the ellipse in half before the revolve will tell you how to build the feature.

  • jelte_steur_info
    jelte_steur_info Member Posts: 683 PRO
    Answer ✓

    in the example below I added a line segment to the sketch.

    edited the ellipse radii to be bodyHeight / 2
    (because it's a radius, your body was twice the intended height).

    and added a qNthElement to the query for the face to revolve and it works fine.

    also check out the // commented lines to check what tests I did along the way to check my work while building the featurescript. I've gotten into the habbit of checking such steps in between to understand what the code is generating before I move on.

    https://cad.onshape.com/documents/a7905757070ccf4e67f9e49c/w/df474a3b80f19aa8e81081ba/e/a76e8f8e388f4fa30d9e2817