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.

OP revolve constantly failing in onshape feature script

matthew_rosete380matthew_rosete380 Member Posts: 10

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

  • jelte_steur814jelte_steur814 Member Posts: 401 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

Answers

  • jelte_steur814jelte_steur814 Member Posts: 401 PRO

    the feature is giving the proper warning:

    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_steur814jelte_steur814 Member Posts: 401 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

Sign In or Register to comment.