From: David Tanner (dtanner_at_ks.uiuc.edu)
Date: Fri Jul 11 2008 - 09:32:53 CDT

Abu Naser,

If I correctly understand your question on adding one to the index in tcl;
that can be done as follows:

set output_index [expr $index + 1]
puts $f "$name $output_index"

I hope that was what your were asking.

Thanks,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:
: David E. Tanner
:
: Theoretical and Computational Biophysics Group
: Beckman Institute, Room 3159
: University of Illinois at Urbana-Champaign
: 405 N. Mathews
: Urbana, IL 61801
:
: dtanner_at_ks.uiuc.edu
:
: (217) 244 - 2905
:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Fri, Jul 11, 2008 at 6:07 AM, Abu Naser <likhonnaser_at_hotmail.com> wrote:

>
> 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/
>