FS- Using mate connector as a plane for a sketch

ben_partouch
ben_partouch Member, csevp Posts: 168 PRO
Hi,

Can anyone please help with this? I know it's super basic. Yet I can't figure out the right code...

Thanks,

Comments

  • xTimRice
    xTimRice Member Posts: 61 PRO
    I think you’ll want to use evPlane on the mate connector: https://cad.onshape.com/FsDoc/library.html#evPlane-Context-map

    It returns a plane that you can then use in the new sketch. 
    Handcrafted furniture in Boston
    https://thesmoothcut.com/
  • ben_partouch
    ben_partouch Member, csevp Posts: 168 PRO
    Thanks Tim!

    It does't fail like before but I can't manage to see the sketch entity.

    var sketchPlane = evPlane(context, {
                    "face" : definition.location (the make connector)
                });



            var sketch1 = newSketch(context, id + "sketch1", {
                    "sketchPlane" : qCreatedBy(makeId("face"), EntityType.FACE)
                });
            // Create sketch entities here
            skCircle(sketch1, "circle1", {
                        "center" : vector(0, 0) * inch,
                        "radius" : definition.holeSize * 2
                    });


            skSolve(sketch1);
  • ben_partouch
    ben_partouch Member, csevp Posts: 168 PRO
    I think I got it. Thank you @TimRice
  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,126 image
    Always use newSketchOnPlane. 
    Senior Director, Technical Services, EMEA
  • ben_partouch
    ben_partouch Member, csevp Posts: 168 PRO
    Thanks @NeilCooke!