Use a vertex in skRectangle()

Lee_Hesketh
Lee_Hesketh Member, Developers Posts: 148 ✭✭✭
Hi, how could I use a vertex's coordinates as the "firstCorner" coordinates for an skRectangle() function? Am I right by thinking that it must be a 2d vector and I could get it since I am using evVertexPoint, I could use vertexPoint[0] etc., but that only works if the part is in the correct orientation?
Thanks
Lee Hesketh
There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!

Best Answers

Answers

  • Lee_Hesketh
    Lee_Hesketh Member, Developers Posts: 148 ✭✭✭
    @ilya_baran How would I manipulate these coordinates to translate it horizontally or vertically?
    There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,274 image
    Once you're in 2D, you should be able to add to the x coordinate to translate horizontally and to y to translate vertically.  Or did I misunderstand your question?
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Lee_Hesketh
    Lee_Hesketh Member, Developers Posts: 148 ✭✭✭
    Well this is what I've written in the code
    skRectangle(sketch1, "rectangle1", {
                                            "firstCorner" : vector(width, -height),
                                            "secondCorner" : worldToPlane(sketchplane, vertexPoint)
                                        });
    How could I separate the x and y coordinates of the secondCorner to translate the point?
    There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
  • Lee_Hesketh
    Lee_Hesketh Member, Developers Posts: 148 ✭✭✭
    @ilya_baran Thank you so much!
    There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!