Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ieatacid
in reply to: BrianEkins

This "just works" and selects the correct face to add the plane to. Still, I'd like to find a way to be absolutely sure it's the same face as the hole's face.

    Face planarFace = null;

    for (int i = m_extrudeFace.Edges.Count; i > 0; i--)
    {
        Edge edge = m_extrudeFace.Edges[i];

        if (edge != null)
        {
            int nFaces = edge.Faces.Count;

            for (int j = 1; j <= nFaces; j++)
            {
                Face face = edge.Faces[j];

                if(face.SurfaceType == SurfaceTypeEnum.kPlaneSurface)
                {
                    Message("Planar surface found!");
                    planarFace = face;
                }
            }
        }

    }

    if(planarFace != null)
    {
        WorkPlane workPlane = workPlanes.AddByPlaneAndOffset(planarFace, 0);
        workPlane.Visible = true;
    }