For the record I have not test your code. To me, it looks like a recorded macro.
If I understood correctly, you'd need to do a before and after comparison on the bodies folder with regards to the FeatureCut3 line. That way you'll be able to get the two, three or however many bodies that get added to the bodies feature after your cut. I hope that by largest you mean largest by volume. If so then you can use the method IBody2::IGetMassProperties. This will return a variant of doubles, the third double is the value of the volume in cubic meters.
Hope this helps!
Ultimately, after thinking more about it, all I'm looking to do is be able to select all bodies created by an Extruded-Cut. I'll post some code soon.
Alright, I was able to get it working by finding the faces that the extruded-cut exposed, getting the bodies associated with the face, and storing their names in a Collection. This is only partial code as all of this is modifying a much larger (and messy) macro.
'Selecting bodies from last cut extrude (that are in a collection)
For ii = 1 To selectedBodies.count
boolstatus = Part.Extension.SelectByID2(selectedBodies(ii), "SOLIDBODY", 0, 0, 0, True, 8, Nothing, 0)
'Perform new Extruded-Cut
Part.FeatureManager.FeatureCut3 True, False, True, 4, 0, 0.0254, 0.0254, False, False, False, False, 0, 0, False, False, False, False, False, True, False, True, False, False, 0, 0, False
'select extrude-cut feature name
SlicedBody = Part.FeatureByPositionReverse(0).Name
'Selects extrude-cut feature for allowing selection of faces
boolstatus = Part.Extension.SelectByID2(SlicedBody, "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)
Set swSelMgr2 = Part.SelectionManager
Set CutSurface = swSelMgr2.GetSelectedObject6(1, -1)
Dim cutFace As Variant
cutFace = CutSurface.GetFaces:
If IsEmpty(cutFace) Then
'Ideally we clear selectedBodies Collection here, but .clear doesn't work in SW
For Each oneFace In cutFace
Set swFace = oneFace
'Adding body of selected face to selectedBodies Collection
Set swBody = swFace.GetBody