Creating a Query from a Plane

graham_lock
graham_lock Member Posts: 277 PRO

Hi,

I have the following code:

var horizontalPartSketchPlane = evFaceTangentPlane(context, {
"face" : face,
"parameter" : vector(0.5, 0.5)
});

var skHorizontalPart = newSketch(context, id + faceIndex + "skHorizontalPart", {
"sketchPlane" : horizontalPartSketchPlane as Query
});

Which fails at the sketchPlane attribute.

What's the correct way to convert the plane entity to a query please?

Thank you.

Best Answer

  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,121 image
    Answer ✓

    newSketchOnPlane (context is Context, id is Id, value is map) returns Sketch

    Create a new sketch on a custom plane, specified by a Plane object. The sketch coordinate system will match the coordinate system of the plane.

    Parameter

    Type

    Additional Info

    value

    map

    • sketchPlane

    Plane

    EXAMPLE

    plane(vector(0, 0, 0) * inch, vector(0, 0, 1))

     

    to sketch on the world XY plane.

    Senior Director, Technical Services, EMEA

Answers

  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,121 image
    Answer ✓

    newSketchOnPlane (context is Context, id is Id, value is map) returns Sketch

    Create a new sketch on a custom plane, specified by a Plane object. The sketch coordinate system will match the coordinate system of the plane.

    Parameter

    Type

    Additional Info

    value

    map

    • sketchPlane

    Plane

    EXAMPLE

    plane(vector(0, 0, 0) * inch, vector(0, 0, 1))

     

    to sketch on the world XY plane.

    Senior Director, Technical Services, EMEA