From: Justin Gullingsrud (
Date: Thu Mar 29 2001 - 11:53:11 CST


In VMD 1.6.1 we added 'getbonds' and 'setbonds' commands to Python (and Tcl)
atom selections. getbonds returns a list of bond lists for each atom in
the selection. setbonds takes a list of lists as an argument; you'd use this
to change the bond for a selection of atoms. It's probably easiest to
get the current bondlist, modify it, then call setbonds with the modified

Though one can call Python scripts from VMD's Tcl interpreter with the
gopython command, it's currently not possible to do the reverse. We'll
look into making this possible with the next release.

Essentially all the commands available through VMD's Tcl interface have a
counterpart in the Python interface. A notable exception is the set of
'measure' commands for computing things like RMS devations. We think the
Python interface will make it easier to write more complex scripts and
extension to VMD, and it will continue to grow over time. We're still very
interested in feedback on the Python interface.



On Thu, Mar 29, 2001 at 04:57:32PM +0200, Aitor Gonzalez wrote:
> Dear VMD-L,
> I would like to add and delete bonds in a python script. I know , that
> this is possible with the 'pickbond.txt' of the script library, but I
> don't know, how to use this function in my script.
> A more general question (or maybe the same question) how it's possible to
> call tcl scripts for vmd from the python interface.
> Are all vmd specific tcl commands also available for python?
> Aitor Gonzalez
> Tef: +49-(0)6221-452012
> Heidelberg, Germany

Justin Gullingsrud      3111 Beckman Institute
H: (217) 384-4220       I got a million ideas that I ain't even rocked yet...
W: (217) 244-8946       -- Mike D