From: Abu Naser (likhonnaser_at_hotmail.com)
Date: Fri Jul 11 2008 - 06:07:05 CDT

hi all user,

I wanted to pick atom index from the screen and append them to a file. I wrote a script for that and pasted below.
I also want to add one to the index. I tried many ways and could not figure out how to do that. I would appreciate
if anybody let me know that.

with regards,

Abu

proc id_pick {} {
     # get the atom and molecule picked
     global vmd_pick_atom vmd_pick_mol
     # get the coordinates
     set sel [atomselect $vmd_pick_mol "same residue as index $vmd_pick_atom"]
     # get residue name and id
     set atom [atomselect $vmd_pick_mol "index $vmd_pick_atom"]
     lassign [$atom get {name index}] name index
     # print the result
     set f [open "index.txt" a]
     puts $f "$name $index"
     close $f
}

proc id_pick_trace_fctn {args} {
      id_pick
}

trace variable vmd_pick_atom w id_pick_trace_fctn
trace vdelete vmd_pick_atom w id_pick_trace_fctn

_________________________________________________________________
Play and win great prizes with Live Search and Kung Fu Panda
http://clk.atdmt.com/UKM/go/101719966/direct/01/