Hi,
You can try that for a tube.
Sub main()
'Measures the minimum distance between plane faces that have a parallel normal
Dim oPart As PartDocument = ThisApplication.ActiveDocument
Dim oPartCompDef As PartComponentDefinition = oPart.ComponentDefinition
Dim oMeasure As Double = 12 'Maximum thickness
For Each oFace As Face In oPartCompDef.SurfaceBodies(1).Faces
If oFace.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then
Dim params(3) As Double
Dim Normals(2) As Double
oFace.Evaluator.GetNormal(params, Normals)
Dim oUnitNormal As UnitVector = ThisApplication.TransientGeometry.CreateUnitVector(Normals(0),Normals(1),Normals(2))
For Each oFace2 As Face In oPartCompDef.SurfaceBodies(1).Faces
If oFace2.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then
Dim params2(3) As Double
Dim Normals2(2) As Double
oFace2.Evaluator.GetNormal(params2, Normals2)
Dim oUnitNormal2 As UnitVector = ThisApplication.TransientGeometry.CreateUnitVector(Normals2(0),Normals2(1),Normals2(2))
If oUnitNormal.IsParallelTo(oUnitNormal2) Then
oMeasure2 = ThisApplication.MeasureTools.GetMinimumDistance(oFace, oFace2.PointOnFace) * 10
If oMeasure2 > 0 And oMeasure2 < oMeasure Then oMeasure = oMeasure2
End If
End If
Next
End If
Next
MessageBox.Show(Round(oMeasure))
End Sub
There may be simpler. To develop.
Vincent.