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.

Options

FS- Using mate connector as a plane for a sketch

ben_partouchben_partouch Member Posts: 101 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

  • Options
    xTimRicexTimRice Member Posts: 59 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/
  • Options
    ben_partouchben_partouch Member Posts: 101 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);
  • Options
    ben_partouchben_partouch Member Posts: 101 PRO
    I think I got it. Thank you @TimRice
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,415
    Always use newSketchOnPlane. 
    Senior Director, Technical Services, EMEAI
  • Options
    ben_partouchben_partouch Member Posts: 101 PRO
    Thanks @NeilCooke!

Sign In or Register to comment.