Recommended approach for finding which face of a solid a sketch was created on?

nick_dombroski
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?

Screenshot 2026-01-06 at 2.54.35 PM.png

Comments

  • lana
    lana Onshape Employees Posts: 782 image

    You can use evOwnerSketchPlane to get sketchPlane and then selectedBody→qOwnedByBody(EntityType.FACE)->qCoincidesWithPlane(thePlane); to find same plane faces.