From: Robert Elder (
Date: Fri Jun 02 2017 - 14:12:43 CDT

Hello all:

I find the commands `save_reps` and `restore_reps` quite useful for
manipulating representations, for instance copying representations from one
molecule to another using the associated $representations array variable.

However, I have noticed that restore_reps behaves strangely. The reason is
it does not correctly delete all existing representations before re-adding
the saved representations. Here is a simple fix to the restore_reps proc in

Change this:

#delete current representations
for {set i 0} {$i < [molinfo $mol get numreps]} {incr i} {
mol delrep $i $mol

To this:

#delete current representations
set numreps [molinfo $mol get numreps];
for {set i 0} {$i < $numreps} {incr i} {
mol delrep 0 $mol

I suspect these commands are not widely used, but perhaps someone will find
this this fix useful.

Best regards,
Robert Elder