Community
You may use PartComponentDefinition.MassProperties.CenterOfMass property.
Related DevBlog post:
http://adndevblog.typepad.com/manufacturing/2012/06/how-to-retrieve-the-barycenter-of-a-part.html
The following thread could be useful as well:/inventor-customization/surfacebody-properties-via-api/td-p/4853851
The choice is up to you. Using RangeBox to approximate centroid position could give too rough estimates. Personally I would prefer to get the centroid from the transient single-body model.
Cheers,