@Khoa_NguyenDang
This will display the volume of each Solidbody in a part document:
Sub Main
If ThisApplication.ActiveDocumentType <> kPartDocumentObject Then MessageBox.Show("This rule is designed to only work in part documents.", "Wrong Document Type") : Exit Sub
Dim pDef As PartComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
If pDef.SurfaceBodies.Count < 1 Then MessageBox.Show("No Solids Exist", "Termination") : Exit Sub
For Each sb As SurfaceBody In pDef.SurfaceBodies
MessageBox.Show("Internal Calculation [cm^3]: " & Round(sb.Volume(0.0001), 5) & vbCrLf & _
"Converted Calculation [in^3]: " & Round((sb.Volume(0.0001)/(2.54^3)), 5) , "Volume for " & sb.Name & ":")
Next
End Sub
Let me know if you have any questions.