Private Sub Command1_Click()
swMassPropertiesStatus_OK = 0
swMassPropertiesStatus_UnknownError = 1
swMassPropertiesStatus_NoBody = 2
Const swUpdateMassPropsDuringSave As Long = 30
Dim swApp As Object
Dim swModel As Object
Dim sFileName As String
Dim vConfNameArr As Variant
Dim sConfigName As String
Dim vMassProp As Variant
Dim i As Long
Dim bRet As Boolean
Dim weight As Single
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
sFileName = swModel.GetPathName
vConfNameArr = swModel.GetConfigurationNames
For i = 0 To UBound(vConfNameArr)
sConfigName = vConfNameArr(i)
vMassProp = swApp.GetMassProperties(sFileName, sConfigName)
weight = vMassProp(5)
Text1.Text = Str(weight)
Next i
End Sub