How to Query World Axes

marena_richardson
marena_richardson Member Posts: 20 EDU
I am trying to rotate a part 90 degrees around standard world coordinate system axes (x, y, z). I know how to use opTransform and rotationAround to do that, but I am not sure how to query for the world axes. 

Comments

  • kevin_o_toole_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    edited January 2016
    The world axes aren't created as entities in a default part studio – just the origin and the default planes. However, if I understand what you're asking correctly, you don't need to create an axis entity.

    rotationAround() takes in a Line object, which can be constructed from just data. You can make a rotation around the x axis like so:
    var xAxis is Line = line(vector(0, 0, 0) * inch, vector(1, 0, 0));
    var transform is Transform = rotationAround(xAxis, 90 * degree);


  • marena_richardson
    marena_richardson Member Posts: 20 EDU
    Yep, that's what I was asking. Thanks!