OP revolve constantly failing in onshape feature script
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:
Best 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.
1
Answers
-
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.0 -
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.
1
