query document origin?

adamohern
adamohern Member, OS Professional Posts: 216 PRO
edited April 2016 in FeatureScript
What's the most robust way to query the document origin?

EDIT: And while I'm at it, what about the default planes?

Comments

  • kevin_o_toole_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    qCreatedBy(makeId("Origin"));
    Now, technically someone upstream could have deleted the Part Studio's origin, but you can always just make your own origin and use that:
    opPoint(context, id + "origin", {
            "point" : vector(0, 0, 0) * inch
    });
    debug(context, qCreatedBy(id + "origin"));
  • adamohern
    adamohern Member, OS Professional Posts: 216 PRO
    Perfect. Thanks!