From: Sandip Mondal (sandchem13_at_gmail.com)
Date: Wed Apr 18 2018 - 09:29:43 CDT

Dear user,

    I am new in writing tcl script. I wrote a simple script for writing
selected regions in pdb format from a dcd.

    The script is as follows

set atoms [atomselect top "not water"]
set nf [molinfo top get numframes]
set out [open "file.pdb" w]
for {set i 0} {$i < $nf} {incr i} {
if {$i == 123} {
$atoms frame $i
$atoms writepdb $out
}
}

     Here 123th frame of a dcd is just for example. This script doesn't
write anything in that $out file, however it creates a new file which I
expect in $out file. Can you plz suggest the way.

Thanking you,
Sandip