From: Patzschke, Dr. Michael (
Date: Mon Sep 03 2018 - 03:37:35 CDT


I would like to acknowledge the help of Vishnu K and Eduard Schreiner. I
have a much better script now and I am quite happy with the results.

In case anyone is interested, here is the improved version. It requires
picking the central atom, after running the script glass cylinders are added
between the central atom and all atoms less than a defined value away. I am
sure the script could be made more pretty and shorter. I am of course open
to suggestions. But this works for me:

proc glass_bond {} {
   global vmd_pick_atom vmd_pick_mol

set sel [atomselect top "(within 2.6 of index $vmd_pick_atom) and (not index
set atomList [$sel list]

foreach atom $atomList {

   set sel1 [atomselect top "index $atom"]
   set sel2 [atomselect top "index $vmd_pick_atom"]

   # coordinates of ligand atom
   set name1 [$sel1 get name]
   set coords1 [lindex [$sel1 get {x y z}] 0]

   # coordinates of the metal
   set name2 [$sel2 get name]
   set coords2 [lindex [$sel2 get {x y z}] 0]

   # and draw the line
   draw material BlownGlass
   draw cylinder $coords1 $coords2 radius 0.1

   set dist [measure bond [list $atom $vmd_pick_atom]]
   puts "Distance $name2 - $name1 : $dist"

Kind regards,

Am Fri, 31 Aug 2018 16:01:28 +0200 schrieb "Patzschke, Dr. Michael"
> Hello,
> I am using vmd to visualize metal complexes. It is customary and helpful, to
>use a different style for the metal to ligand bonds as compared to the
>intra-ligand bonds. Unfortunately, this seems not to be straight forward in
> I have had some success with defining a new rep. There I use something like
>"all within 5 of name Eu" to define the area around the central ion (e.g.
>europium), then I use Dynamic Bonds as the drawing method and change the
>Distance Cutoff, so that all metal-ligand interactions are shown. I then use
>a transparent material for these bonds.
> The effect is quite pleasing, but the problem is, that this procedure also
>leads to bonds between the ligand atoms. As the ligand-ligand atom distances
>are very similar to the ligand-metal distances, there is no way to prevent
>this from happening.
> I also tried to add cylinders between the atoms of interest, but with
>several eight-fold coordinated metal centres adding dozens of cylinders gets
>very cumbersome. So I tried to cobble together a script:
> proc glass_bond {} {
> global vmd_pick_atom vmd_pick_mol
> set sel1 [atomselect top "index 105"]
> set sel2 [atomselect $vmd_pick_mol "index $vmd_pick_atom"]
> # coordinates of metal
> set coords1 [lindex [$sel1 get {x y z}] 0]
> # coordinates of the atom
> set coords2 [lindex [$sel2 get {x y z}] 0]
> # and draw the line
> draw material BlownGlass
> draw cylinder $coords1 $coords2 radius 0.1
> puts "Start: $coords1"
> puts "End: $coords2"
> }
> This is a bit more practical, but one needs to change the first atomselect
>by hand and start the script for every picked ligand atom.
>Finally, I have tried the following approach, I measure the distance between
>the atom pairs of interest and make the labels as small as possible, this
>yields dotted lines between metal and ligand atoms. This is not extremely
>beautiful and there is an additional problem. When I render this TachyonL
>Optix, the dotted lines get blown up to enormous rings and are not usable.
> Is there any simple way to produce the desired result in vmd I have
>overlooked? Would anyone have a suggestions to improve my script so that one
>can pick two atoms and then draw a cylinder between them. And even better
>would it be possible to set the colour of the cylinders to that of the first
>picked metal atom?
> Kind regards,
> Michael