I have VB6, but not the time to do it at the moment. I can give you code to compute and retrieve the mass if you have any programming experience at all. Otherwise I'm off until next Tuesday. Attached is an .exe but it will only do one model at a time. Next week I can maybe make it cycle through all models in a directory.
Here's the code:
Public objModel As SolidEdgePart.Model
Public seApp
Dim objVariables As SolidEdgeFramework.Variables
Dim objVariable As SolidEdgeFramework.variable
Dim objVar1 As SolidEdgeFramework.variable
Public dbldensity As Double
Public dblAccuracyIn As Double
Public dblAccuracyOut As Double
Public dblVolume As Double
Public dblArea As Double
Public dblMass As Double
Public dblCofGravity() As Double
Public dblCofVolume(1 To 3) As Double
Public dblGlobalMoments(1 To 6) As Double
Public dblPrincipalMoments(1 To 3) As Double
Public dblPrincipalAxes(1 To 9) As Double
Public dblRadiiOfGyration(1 To 3) As Double
Public lngStatus As Long
Public dblStartRadiusArray() As Double
Public dblEndRadiusArray() As Double
Sub Main()
Set seApp = GetObject(, "SolidEdge.Application")
Set objModel = seApp.activedocument.Models(1)
'Get Variables Collection
Set objVariables = seApp.activedocument.Variables
'Create a variable with Add method
'Get a reference to Variable1 using Item method
Set objVar1 = objVariables.Item(1)
100
'MsgBox objVariables.Item(3).Name
dbldensity = objVariables.Item(1).Value
dblAccuracyIn = objVariables.Item(3).Value
Call GET_MASS(dbldensity)
MASS = dblMass
End Sub
Function GET_MASS(dbldensity)
' Recompute to ensure correct model info
Call objModel.ComputePhysicalProperties( _
Density:=dbldensity, Accuracy:=dblAccuracyIn, Volume:=dblVolume, _
Area:=dblArea, MASS:=dblMass, CenterOfGravity:=dblCofGravity, _
CenterOfVolume:=dblCofVolume, _
GlobalMomentsOfInteria:=dblGlobalMoments, _
PrincipalMomentsOfInteria:=dblPrincipalMoments, _
PrincipalAxes:=dblPrincipalAxes, _
RadiiOfGyration:=dblRadiiOfGyration, _
RelativeAccuracyAchieved:=dblAccuracyOut, Status:=lngStatus)
' Retrieve properties
Call objModel.GetPhysicalProperties(lngStatus, dbldensity, dblAccuracyIn, dblVolume, dblArea, dblMass, dblCofGravity, dblCofVolume, dblGlobalMoments, dblPrincipalMoments, dblPrincipalAxes, dblRadiiOfGyration, dblAccuracyOut)
Set X = seApp.activedocument.Properties.Item("Custom").Add("MASS", Round(dblMass, 3) * 2.20462262)
End Function