Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Is there a way to get the XYZ coordinates of a mouse clicked point on an object? (Featurescript)
mehmet_reşat_halıcı
Member Posts: 2 EDU
in General
Hello everyone,
I am almost entirely new to featurescript. I would like the user to select a point (any point) on a surface and receive its XYZ coordinates. My end goal is to create mate connectors at that given coordinate. Sadly, queries only allow you to select existing vertices and so on. From what I've seen, the closest thing to this was prompting the user to select a reference point and then let them manipulate it with 3 other queries for the respective coordinates. I've looked at raycasts, but they seem different from a raycast that would be in something such as a game engine. Is there something I am overlooking? Your help is greatly appreciated.
I am almost entirely new to featurescript. I would like the user to select a point (any point) on a surface and receive its XYZ coordinates. My end goal is to create mate connectors at that given coordinate. Sadly, queries only allow you to select existing vertices and so on. From what I've seen, the closest thing to this was prompting the user to select a reference point and then let them manipulate it with 3 other queries for the respective coordinates. I've looked at raycasts, but they seem different from a raycast that would be in something such as a game engine. Is there something I am overlooking? Your help is greatly appreciated.
0
Answers
https://cad.onshape.com/documents/1a55ad6f72725030622fcaed/v/81612ea7570b93f7d4fed9c9/e/04184ad223c3e4e93f00010c
I got it to work with two tangent manipulators. I think it works quite intuitive for the user this way.
Couldn't help myself and clean the feature up and finish it for a published version.
https://cad.onshape.com/documents/1a55ad6f72725030622fcaed/v/3c016bc158695074012ef1c2/e/e52fcce23bf1b6e4f743df3c?renderMode=0&uiState=665d87e859cc5e4992a88c1d