
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a solid body made by a single feature Extrude. A simple plate. I wish to find face pair, of two bigger faces, which are opposite of each other.
For a function, I pass one of the big faces, and wish to find opposite face of it, within same body. Tried following logic but does not work:
Private Function findDistanceToOppsiteFace(ByRef face As Inventor.Face, ByRef feat As PartFeature) As Double
findDistanceToOppsiteFace = 0.0
Dim origin As Inventor.Point = face.PointOnFace
Dim pt(2) As Double
Dim n(2) As Double
pt(0) = origin.X : pt(1) = origin.Y : pt(2) = origin.Z
face.Evaluator.GetNormalAtPoint(pt, n)
Dim normal As Inventor.UnitVector = _invApp.TransientGeometry.CreateUnitVector(n(0), n(1), n(2))
Dim body As SurfaceBody = feat.SurfaceBodies.Item(1)
Dim radius As Double = Math.Sqrt(face.Evaluator.Area) * 2.0
Dim objects As ObjectsEnumerator
Dim pts As ObjectsEnumerator
Dim objtypes(0 To 1) As SelectionFilterEnum
objtypes(1) = SelectionFilterEnum.kPartFaceFilter
'body.FindUsingRay(origin, normal, radius, objects, pts, True)
objects = m_partDoc.ComponentDefinition().FindUsingVector(origin, normal, objtypes)
findDistanceToOppsiteFace = _invApp.MeasureTools.GetMinimumDistance(origin, objects.Item(1))
End Function
Solved! Go to Solution.