If the ID dimension is always going to be a cylindrical face (even if not complete circle), and not a angled like a cone or rounded, then a simple code like this might work for you.
It loops through each body, then each face of each body, checking if the face is cylindrical shaped, then defines its geometry as a mathematical (transient) cylinder, then gets its radius (x2 for Dia.) then adds that Diameter to a list. At the end, it compares all the diameters in the list to find the smallest one, and returns that as the ID.
It's a very simple code, and could probably use a few checks to avoid possible errors, but works for my test part.
I have the math to return Inches, so you can delete the "/2.54" if you want centimeters.
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oDs As New List(Of Double)
For Each oBody As SurfaceBody In oPDef.SurfaceBodies
For Each oFace As Face In oBody.Faces
If oFace.SurfaceType = SurfaceTypeEnum.kCylinderSurface Then
Dim oCyl As Cylinder = oFace.Geometry
oDs.Add((oCyl.Radius * 2)/2.54)
End If
Next
Next
Dim oSmallestID As Double = oDs.Min
MsgBox("The smallest ID of all Cylindrical surfaces found = " & oSmallestID.ToString)
Wesley Crihfield

(Not an Autodesk Employee)