From: Nitin Bhardwaj (nbhardwaj_at_gmail.com)
Date: Tue Dec 19 2006 - 10:54:29 CST

Dear VMD users,
  I want to calculate the average z-coordinate of a selection (say a
protein). I can extract the center of the protein, but how do I further
extract just the z-coordinate from the center? Here is my script.

set mol [molinfo top]
set protein [atomselect $mol protein]
for {set i 0} {$i < 1} {incr i} {
 $protein frame $i
 set center [measure center $protein]
 puts $center
 }

I am a novice in writing Tcl scripts. I am sure its a trivial job. I think I
am missing just one expression to extract the z-coordinate of the center.

thanks a lot in advance,
Rgds,
Nitin