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

Onshape Featurescript Query - return XYZ coordinates of a mouseclicked point on a part

joshua_lee840joshua_lee840 Member Posts: 6
edited November 2022 in Community Support
Hello Onshape:

I want to make a featurescript that queries for the user to click a point on a surface or edge, then returns the XYZ coordinates of the spot that was clicked. This would greatly simplify a lot of work for certain kinds of freehand work that I have been doing recently. I have attached an image to serve as an example.

I noticed that right-clicking the model and choosing [Select Other] in the dropdown menu causes a yellow symbol to hover over my surface, which is very close to what I want. Can you advise me on how to access this XYZ-coordinate?

My end goal is to create mate connectors at selected points with the Z axis sticking out normal to the surface. Some of the objects I work with have organic shapes that require a lot of trial and error to get the right mate locations.

Sincerely,
Joshua Lee


 

Answers

  • Options
    MichaelPascoeMichaelPascoe Member Posts: 1,717 PRO
    edited November 2022
    Check out the functionality of Freeform Spline by @Evan_Reese. It has some very nice manipulators that are doing something similar to what you need. With this technique, you could click the face, then drag the manipulator to the point you want.

    Also try Face curves by Evan as well.

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Options
    joshua_lee840joshua_lee840 Member Posts: 6
    Thanks! I will take a look.
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
    mine uses evDistance to find the closes point on the target object and snap to it. I've really wanted the thing you're describing though! I think this is how match connections in Loft should work anyway when matching to an edge. It just defaults them all to a parameter of 0.5, which is often in a nonsense spot, or makes points overlap when referencing the same edge twice and therefore makes it tough to drag where you want.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
Sign In or Register to comment.