Anonymous
in reply to:
Anonymous
08-22-2019
07:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-22-2019
07:57 AM
I have found a solution. Without error checking, it works as follows:
//get the extrude feature and type of extent, here assumed to be of type kToExtent ExtrudeFeature extFeat = oCompDef.Features[1]; ToExtent toExt = extfeat.Extent as ToExtent; PlanarSketch sketch = extFeat.Profile.Parent as PlanarSketch; UnitVector sketchNormal = sketch.PlanarEntityGeometry.Normal; //since ToFace returns a face collection, we grab the first Faces extentFaces = toExt.ToFace as Faces; Face extentFace = extentFaces[1]; //find the distance from a sketch point to a characteristic point on the face which defines the ToExtent, normal along the sketch plane. double depth = sketch.SketchPoints[1].Geometry3d.VectorTo(face.PointOnFace).DotProduct(sketchNormal.AsVector());