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.
Recommended approach for finding which face of a solid a sketch was created on?
nick_dombroski
Member Posts: 2 ✭
Hello,
In my use of FeatureScript, I have a fairly common need to do the following: given an edge and a solid object, identify which face of the solid the edge lies on (if any). I'm wondering generally what is the best approach to take for this.
This has come up in several contexts, but to come up with a simplified scenario to better illustrate what I mean: let's say my feature takes Part 1 as an EntityType.BODY input, and the highlighted edge of Sketch 2 as an EntityType.EDGE input. I want to do something to the face of Part 1 on which Sketch 2 lies. What is considered best practice for obtaining a query that selects that face?

Comments
You can use
evOwnerSketchPlaneto get sketchPlane and thenselectedBody→qOwnedByBody(EntityType.FACE)->qCoincidesWithPlane(thePlane);to find same plane faces.