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.

Sketch "Use" in featurescript

gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
I cannot find the function to "Use (Project/Convert)" an existing face (which the feature user would define), onto a sketch that I create in my featurescript.

Is it not implemented, or am I just failing at finding it?

Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Sketch "use" is not available as a FeatureScript function. "Use" when modeling interactively acts to create individual lines, arcs, ellipses, splines, etc as needed so the interactive user has control of those individual entities.

    Let use know the larger problem being solved and there is possibly an alternative solution, like using the existing entity as-is, or splitting that entity with a plane and using the split edge.
  • Jacob_CorderJacob_Corder Member Posts: 137 PRO
    You can use Project(plane, point) to project edge points onto a plane. the finer the parameters passed to evEdgeTangentLines, the finer the points will be on the plane. The curvature of the result opFitSpline from these projected points is not as good as you will get using the "Use" function, but it works.

    so desired edge call
    evEdgeTangentLines

    project the line origins returned from evEdgeTangentLines to the desired plane.
    opFitSpline on the projected points.
    Result. spline on plane created.

    If the edge loops back on itself, it will fail and you will need to find out why.

    Imagine a circle perpendicular to a plane. when you project that circle, you will get  points that overlap as it is visibly a line when looking from the plane.

  • gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
    Sketch "use" is not available as a FeatureScript function. "Use" when modeling interactively acts to create individual lines, arcs, ellipses, splines, etc as needed so the interactive user has control of those individual entities.

    Let use know the larger problem being solved and there is possibly an alternative solution, like using the existing entity as-is, or splitting that entity with a plane and using the split edge.
    Thanks. I still think that a feature could have a use for "Use" with e.g. a face provided by the user.

    As you described, I ended up extruding a face, and splitting with the sketch plane. Not as elegant, but it does the job.
  • anna_stillfried645anna_stillfried645 Member Posts: 3

    @kevin_o_toole_1 is it by now possible to create a sketch via feature script with "USE"? That would be extremely helpful for my project.

Sign In or Register to comment.