# load trajectory mol new nacl-water-1.gro waitfor all mol addfile test.trr waitfor all ############################## # define function to (re-)draw the dipole vector proc do_boxdraw {fname molid args} { # delete old box global my_vmd_boxgraph if {[info exists my_vmd_boxgraph]} then { foreach g $my_vmd_boxgraph { graphics $molid delete $g } } # draw new box graphics $molid color iceblue set my_vmd_boxgraph [draw unitcell style rod width 2.5 ] } trace variable vmd_frame(0) w do_boxdraw animate goto 0