Constant errors when trying to compile FeatureScript

alex_vestas
alex_vestas Member Posts: 69 ✭✭

I get constant errors when trying to compile FeatureScript. What is the problem?

https://cad.onshape.com/documents/429e6210f5198eba46d587d4/w/6de781fd87ddbe3f0f8b3da7/e/e099ef0e63da6fe167a1b6fc

Answers

  • GregBrown
    GregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 412 image

    There are a few little things missing:

    1. your skPolyline is not closed (therefore you have no closed region to revolve into a solid. Just add another point vector(0, 0) * millimeter at the end of the array…

    whille developing features you might want to add a debugs like:

    debug(context, qSketchRegion(id + "sketch"));

    to make sure things are as you intend.

    2. the sketch plane needs to be a query. use something like
    var sketch = newSketch(context, id + "sketch", { "sketchPlane" : qCreatedBy(makeId("Front"), EntityType.FACE) });

    3. the opRevolve needs one more parameter:

    "angleForward" : 360 * degree

  • alex_vestas
    alex_vestas Member Posts: 69 ✭✭
    edited September 23

    Thank you Greg, that helped.

    I tried slightly modify code and to add Chamfer to the top of the larger button, but Featurescript didn't accept code and show notices:

    Function qEdgeFilter with 2 argument(s) not found
    45:30
    Feature Studio 1

    Function evEdgeCenter with 2 argument(s) not found
    46:34
    Feature Studio 1

    Can you advice?
    https://cad.onshape.com/documents/429e6210f5198eba46d587d4/w/6de781fd87ddbe3f0f8b3da7/e/14a4127feaa3f8e5106a09df