Hi,
As far as I understand you want to calculate the distance between two or more selections. In that case gmx pairdist is better
To have the com of molecule, you could define the molecule in your index file and use option like -selrpos
Here you find a brief description for the difference between gmx distance gmx pairdist
I hope it helps
Alessandra
Here you find more on Topics tagged gmx-distance