From: Alessandro Ruda (alessandro.ruda_at_su.se)
Date: Sun Feb 27 2022 - 08:03:44 CST

Dear VMD comunity,

 I am trying to get a simple script to obtain coordinates for each frame of a MD trajectory of a specific atom:

----------------------------

set LNB_H1p "XXX_atom1.dat"

set outfile1 [open $XXX_atom1 w]

set nfr [molinfo top get numframes]

### Write coordinates in the files ###

for {set frame 0} {$frame < $nfr} {incr frame} {
set atom1 [atomselect top "index 33"]
set atom1_c [$H1p get {x y z} $frame]
puts $outfile1 $frame\t$atom1_c
}
close $outfile1
----------------------------------

but I can't get it working because get doesn't accept $frame in the sense that it doesn't seem like I can get coordinates for a specific frame using the get command.
Any suggestion?

Thank you in advance!

All the best,
Alex

_____________________________________________________________________

Alessandro Ruda
PhD Student
Department of Organic Chemistry
Arrhenius Laboratory
Stockholm University
SE-106 91 Stockholm, Sweden
<mailto:alessadro.ruda_at_su.se>alessandro.ruda_at_su.se<mailto:alessadro.ruda_at_su.se>
+46707900305
_____________________________________________________________________