From: Rune Thomas Kidmose (
Date: Sun Jun 03 2018 - 14:02:31 CDT

Basically, I cant figure out how to reinitialize VMD before running the same script twice or more in the same session.

My current problem is that I have a script which loads 5 different molecules. During the loading each molecule is then automatic given a mol ID number (0-4) as is standard.

I then use those mol IDs to set various features for specfic molecules (view matrices, modstyles, modmaterials etc. so e.g. mol modcolor 0 3 ColorID 8 etc.). However, if I then make some changes within the tcl script and I want to reload the script to see the effects of the changes, I am hit with the problem that the molecules I now load get new mol ID's assigned (not 0-4 but e.g. 5-9). This means that the mol id specific commands are not executed on the newly loaded molecules. This is of course because I run the script in the same VMD 1.93 session that I just ran the script from. But even if manual delete the molecules before running the script again I still face the same problem.

My current solution is to just restart VDM and run the script, which works, but I cant help to wonder if there is some smart way to mitigate this?

I run the scripts using the play command from the tcl consol.

In PyMol I always start my scripts with the command "reinitialize" which resets everything in PyMol, does something related exist for VMD 1.93 ?

Does what I describe make sense?