From: Leonardo Trabuco (
Date: Tue Dec 15 2009 - 11:30:26 CST

Hi Carsten,

On Tue, Dec 15, 2009 at 3:30 AM, Carsten Olbrich
<> wrote:
> Hallo,
> I am wondering, if there is a possibility to get a list of
> representations IDs (repid), which are needed to modify existing
> representations.
> Additionally, it would be nice if the procedure "mol addrep <mol>"
> would return the ID of the new representation, in a way that one can
> use something like "set NewRepID [mol addrep top]".
> Any suggestion this is highly welcome.

You can do something like this to get both the repid and the repname.
Note that the repname is guaranteed to be unique for a given molecule,
but the repid may change if reps are deleted.

  mol addrep $molid
  set repid [expr [molinfo $molid get numreps] - 1]
  # repname is guaranteed to be unique within a molecule
  set repname [mol repname $molid $repid]

Later on, if you want to, e.g., delete a rep given the repname, you
can do something like:

  set repid [mol repindex $molid $repname]
  mol delrep $repid $molid


> Cheers,
> Carsten

Leonardo Trabuco, Ph.D. candidate
Theoretical and Computational Biophysics Group
University of Illinois at Urbana-Champaign