Hi @C_Haines_ENG. That is a tough one. Another important specification here would be whether you need this 'RangeBox' to be aligned with the model's origin Axes or not. The regular RangeBox, and also the newer PreciseRangeBox properties, both return a Box object that is always aligned with the model's origin axes, whether the actual model geometry is or not. But there is also the OrientedMinimumRangeBox, which returns a OrientedBox, which may not be aligned with the origin axes, but may be a more accurate bounding box of the actual geometry.
I would suggest creating a transient BRep copy of the bounding box, as a transient SurfaceBody. Then iterate through its 6 flat faces, for comparing with the faces of your model. This could potentially include a lot of iterations. Iterate through every normal body, every face of each body, and only really inspect the 'flat' faces. If those 'normal' flat faces are 'co-planar' to any of the transient body's faces, then it is considered an 'outer most face'. As a test, here is an example iLogic rule doing this process, and using a HighLightSet to show you which faces are found to meet that condition.
Sub Main
Dim oInvApp As Inventor.Application = ThisApplication
Dim oDoc As Inventor.Document = oInvApp.ActiveDocument
If (Not TypeOf oDoc Is AssemblyDocument) AndAlso (Not TypeOf oDoc Is PartDocument) Then Return
Dim oCD As Inventor.ComponentDefinition = oDoc.ComponentDefinition
'Dim oRangeBox As Inventor.Box = oCD.RangeBox
Dim oRangeBox As Inventor.Box = oCD.PreciseRangeBox 'new in 2022
If oRangeBox Is Nothing OrElse oRangeBox.MinPoint.IsEqualTo(oRangeBox.MaxPoint) Then Return
Dim oTG As Inventor.TransientGeometry = oInvApp.TransientGeometry
Dim oTBRep As Inventor.TransientBRep = oInvApp.TransientBRep
Dim oTBody As SurfaceBody = oTBRep.CreateSolidBlock(oRangeBox)
Dim oOuterFaces As New List(Of Inventor.Face)
For Each oBody As SurfaceBody In oCD.SurfaceBodies
For Each oFace As Face In oBody.Faces
If (Not TypeOf oFace.Geometry Is Inventor.Plane) Then Continue For
Dim oFacePlane As Inventor.Plane = oFace.Geometry
'now check if this is co-planar to any of the faces of the RangeBox
For Each oTFace As Face In oTBody.Faces
If (Not TypeOf oTFace.Geometry Is Inventor.Plane) Then Continue For
Dim oTFacePlane As Inventor.Plane = oTFace.Geometry
If oFacePlane.IsCoplanarTo(oTFacePlane, 0.001) Then
oOuterFaces.Add(oFace)
End If
Next oTFace
Next oFace
Next oBody
If oOuterFaces.Count = 0 Then
MessageBox.Show("No outer faces found!", "No Outer Faces Found", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Dim oHLS As HighlightSet = oDoc.CreateHighlightSet()
For Each oOuterFace As Face In oOuterFaces
oHLS.AddItem(oOuterFace)
Next oOuterFace
MessageBox.Show("Review highlighted outer faces.", "Outer Faces Highlighted", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
oHLS.Clear
End If
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)