I have 11 elements after meshing, I need the centroid location of each element in a list or file format for using it later. Can someone provide me with the APDL code?
You should be using *VGET. This will return/fill an array of data based on your current elemental selection:
https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v232/en/ans_cmd/Hlp_C_VGET_st.html#vget.prep7
*VGET, ParR, ELEM, n, Item1, IT1NUM, , , KLOOP
CENT X, Y, Z Centroid X, Y, or Z location (based on shape function) in the active coordinate system