From: Clement Fang Jin Koh (
Date: Sun Nov 05 2017 - 22:18:22 CST


I have a system of polymer chains, whose atom indexes of each chain are not
in sequential order (i.e. instead of {1 2 3 4 5 6}, they could be {4 6 5 3
2 1}). For my tcl analysis script I need to reference the first and second
atoms on each chain, then the first and third, and so on.

I tried doing so by atomselecting the fragment, then getting the indexes.
But vmd seems to rearrange the index list to be in sequential order. So {4
6 5 3 2 1} becomes {1 2 3 4 5 6}. So I am unable to reference the correct
atom on the chain by lindex of the index list.

Is there another way to reference the chain atoms? Or another way to get
the indexes without having them pre-sorted?