Public Function COM_X() As Double ' Set a reference to the part document. ' This assumes a part document is active. Dim oPartDoc As PartDocument Set oPartDoc = ThisApplication.ActiveDocument ' Set a reference to the mass properties object. Dim oMassProps As ComponentDefinition Set oMassProps = oPartDoc.ComponentDefinition.MassProperties ' Set the accuracy to medium. oMassProps.Accuracy = k_Medium ' Schwerpunktkoordinaten COM_X = oMassProps.CenterOfMass.X 'Stop End Function