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.
Find face containing point.
jack_white396
Member Posts: 7 EDU
I am very new to featurescript and to coding as a whole, so I imagine this problem has an easy solution. I need to let the user select a point, which I know how to do, but then I need the feature to decide what face contains that point and then use it as the face for a sketch. How would I do this? Thank you so much for any help. This is my current code in case it helps-https://cad.onshape.com/documents/dd9b41942bbf9f447e9d9d6d/w/2b64a0a98ab7927062949adf/e/7a70e61408d6be428a6f3ba7
0
Answers
If you don't want to limit to sketch points I'm not 100% sure, but without trying any of them, maybe qAdjacent or qContainsPoint, and failing those, you could brute force it by querying all of the model faces and then getting the closest one with qClosestTo