I found this SolidWorks help article that might be helpful:
Apparently you can create a coordinate system using reference geometry and get information from the "Mass Property" dialog relative to that coordinate system. I am not sure exactly how to go about this with API commands, but this should be a pretty good starting point.
I would do that task in a different way:
Work at the assembly level.
0. If necessary, insert a Coordinate System at the point where you want to measure.
1. Right-click on the part instance you want and select "Isolate".
2. Click Mass Properties.
2a. Make sure "Include hidden bodies/components" is unchecked. (The Isolate command temporarily hides all other parts in the assembly).
2b. If you are not using the default coordinate system then pull down "Report coordinate values relative to:" and select the coordinate system you inserted earlier.
2c. The result is shown under "Moments of Inertia: Taken at the output coordinate system".
(You can confirm the result is correct using the parallel axis theorem).
try: Interface IMathTransform
by multiplying your part coordinate system by transformation matrix you can get the same as the coordinate system of the assembly;
but it is better to have a Component2 instead of ModelDoc2 : Public Property Transform2 As IMathTransform (Component2 .Transform2)
That sounds promising but the issue would be that I only know what coordinate system the part needs to be in. I do not know how the two coordinate systems relate to each other. I would need some assembly method that could tell you the orientation of a particular part.