From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Mon Jun 17 2013 - 18:37:43 CDT

Hi Alex,

I think you'll be interested in the TCL callbacks
(http://www.ks.uiuc.edu/Research/vmd/current/ug/node156.html). You'll be
wanting to do something like this in the tkCon window (or in your
startup script):

#Make an empty list
set ilist [list ]
#Define a new proc to add new indices to the list.
proc add_to_list {args} {
lappend ::ilist $::vmd_pick_atom
puts $::vmd_pick_atom
}
#Add a trace so that the proc is called whenever an atom is picked
trace add variable vmd_pick_event write add_to_list

After picking a few atoms, you should see that $ilist now contains the
indices of the selected atoms.

Happy Picking!
-Josh Vermaas

On 06/17/2013 04:32 PM, Alex Richards wrote:
> Hi All,
>
> I see that I can "pick" an atom in the OpenGL Display and have some
> identifying information about it posted into the terminal window. I
> would like to be able to "pick" an atom in such manner and automatically
> have it or its index added to a list which I can use in scripting. Is
> there a way to do this that has already been established? I usually use
> the TkConsole and I know that the atom info gets output to the Terminal
> window, so I'm not sure if I can move data back and forth between the
> two anyways. Thank you.
>
> A- R-