There are two potential solutions that I can see. One is to continue the approach you're currently taking but use the API to control the visibility of the work geometry. The following code demonstrates turning them off and then back on. It's not just toggling them, which is what the command does but instead you are specifically specifying if they should be on or off.
Public Sub VisibilityTest()
Dim doc As PartDocument
Set doc = ThisApplication.ActiveDocument
doc.ObjectVisibility.AllWorkFeatures = False
doc.ObjectVisibility.AllWorkFeatures = True
End Sub
The second approach is to be indendent of the work feature display and just work with the range of the bodies. The code below computes a range box that's the combination of all of the bodies in a part.
Public Sub GetBodyRange()
Dim doc As PartDocument
Set doc = ThisApplication.ActiveDocument
Dim bodies As SurfaceBodies
Set bodies = doc.ComponentDefinition.SurfaceBodies
' Initialize the range with the first body.
Dim allRange As Box
Set allRange = bodies.Item(1).RangeBox
Debug.Print "(" & Format(allRange.minPoint.X, "0.000000") _
& ", " & Format(allRange.minPoint.Y, "0.000000") _
& ", " & Format(allRange.minPoint.Z, "0.000000") _
& ")-(" & Format(allRange.maxPoint.X, "0.000000") _
& ", " & Format(allRange.maxPoint.Y, "0.000000") _
& ", " & Format(allRange.maxPoint.Z, "0.000000") & ")"
' Expand the range using any additional bodies.
Dim i As Integer
For i = 2 To bodies.Count
Dim bodyRange As Box
Set bodyRange = bodies.Item(i).RangeBox
Dim minPoint As Point
Dim maxPoint As Point
Set minPoint = allRange.minPoint
Set maxPoint = allRange.maxPoint
If bodyRange.minPoint.X < allRange.minPoint.X Then
minPoint.X = bodyRange.minPoint.X
End If
If bodyRange.minPoint.Y < allRange.minPoint.Y Then
minPoint.Y = bodyRange.minPoint.Y
End If
If bodyRange.minPoint.Z < allRange.minPoint.Z Then
minPoint.Z = bodyRange.minPoint.Z
End If
If bodyRange.maxPoint.X > allRange.maxPoint.X Then
maxPoint.X = bodyRange.maxPoint.X
End If
If bodyRange.maxPoint.Y > allRange.maxPoint.Y Then
maxPoint.Y = bodyRange.maxPoint.Y
End If
If bodyRange.maxPoint.Z > allRange.maxPoint.Z Then
maxPoint.Z = bodyRange.maxPoint.Z
End If
Next
allRange.minPoint = minPoint
allRange.maxPoint = maxPoint
Debug.Print "(" & Format(allRange.minPoint.X, "0.000000") _
& ", " & Format(allRange.minPoint.Y, "0.000000") _
& ", " & Format(allRange.minPoint.Z, "0.000000") _
& ")-(" & Format(allRange.maxPoint.X, "0.000000") _
& ", " & Format(allRange.maxPoint.Y, "0.000000") _
& ", " & Format(allRange.maxPoint.Z, "0.000000") & ")"
End Sub