Getting the z coordinate

From: Isaac Asare Kwaku (
Date: Mon May 17 2021 - 10:59:22 CDT

Hello guys,

This is more of a tcl script problem but I was hoping I could get some
help. I am measuring the center of mass of two different residues of a
protein in VMD. Now I want to find the difference between only the z
coordinates of the center of mass of the residues. The command "measure
center $sel weight mass" gives me the x,y,z coordinates of the center of
mass but I am looking for a way to store just the z coordinates so I can
find the difference between them. I have tried to assign the value
of "measure center $sel weight mass" to a variable as a list so I use
"lindex listname 2" to get the z coordinate. However the assignment of the
output of the "measure" command has proved futile. How do I get only the z
coordinate of the center of mass?


This archive was generated by hypermail 2.1.6 : Fri Dec 31 2021 - 23:17:11 CST