From: Eric Smoll (ericsmoll_at_gmail.com)
Date: Mon Apr 10 2017 - 10:30:03 CDT

Hello VMD users,

Accessing a function returned by atomselect in a proc scope can be done by
specifying the function with the keyword global:

set X [atomselect top all]
proc test {} {
  global X
}

However, I am having trouble updating the global atomselect function in a
proc scope:

set X [atomselect top all]
proc test {} {
  global X
  set X [atomselect top protein]
}
$X get index;# error occurs

Does anyone know how to get something like this working?

Best,
Eric