ANSYS 2023R1
You can get the centroid of bodies or faces directly from the Centroid property of the geodata object. You can get these per the discussion here: https://discuss.ansys.com/discussion/2758/how-to-get-a-list-of-each-object-in-named-selection-use-script#latest
To convert this to a local CS you can use this post as this centroid data is simply XYZ global numeric points:https://discuss.ansys.com/discussion/comment/3103#Comment_3103