Feature Script: How to get the coordinates of a selected point for X and Y

Matthew380
Matthew380 Member Posts: 50 ✭✭

So I just started working on featured script and was trying to get the X coordinate for a point that you select. However I have no idea how to do that can someone help?

Best Answer

  • jelte_steur_info
    jelte_steur_info Member Posts: 683 PRO
    Answer ✓

    did you follow the course in the learning center?

    https://learn.onshape.com/learn/course/featurescript-fundamentals

    fromt the standard library Documentation:

    evVertexPoint (context is Context, arg is map) returns Vector

    Vector type

    A Vector is a non-empty array. It should contain numbers or lengths.

    Operators +, -, *, and / are overloaded for vectors, and other operations such as dot product are available. If a vector does not contain numbers or lengths, operations that assume number-like properties may fail.

    vector (x, y, z) returns Vector

    Construct a 3-dimensional vector.

    reading through the documentation you should figure out that you need the first entry from the array returned by evVertexPoint.

Answers

  • jelte_steur_info
    jelte_steur_info Member Posts: 683 PRO
    Answer ✓

    did you follow the course in the learning center?

    https://learn.onshape.com/learn/course/featurescript-fundamentals

    fromt the standard library Documentation:

    evVertexPoint (context is Context, arg is map) returns Vector

    Vector type

    A Vector is a non-empty array. It should contain numbers or lengths.

    Operators +, -, *, and / are overloaded for vectors, and other operations such as dot product are available. If a vector does not contain numbers or lengths, operations that assume number-like properties may fail.

    vector (x, y, z) returns Vector

    Construct a 3-dimensional vector.

    reading through the documentation you should figure out that you need the first entry from the array returned by evVertexPoint.