From: Maxim Belkin (
Date: Thu Jan 30 2014 - 09:58:25 CST

Hi Tristan,
You can easily automate it by writing a tiny proc for that:

proc updatetrajectory {dcdfile {step 1} {mol top}} {
        set n [molinfo $mol get numframes]
        mol addfile $dcdfile first [expr {$n*$step}] step $step waitfor all $mol

Put it into your .vmdrc or any other file and source it.
Then, you can use either of the commands:

updatetrajectory trajectory.dcd
updatetrajectory trajectory.dcd 5
updatetrajectory trajectory.dcd 5 0

In the above proc, “step" and “mol" are optional arguments that default to “1” and “top”, correspondingly. “mol” at the end of “addfile” command ensures that frames are added to the right molecule. “waitfor all” ensures that proc waits for all frames to be loaded.


On Jan 29, 2014, at 10:39 PM, Tristan Croll <> wrote:

> When monitoring the progress of a running trajectory, I find myself typing out the following command quite regularly to add the new parts to what I already have loaded in VMD:
> mol addfile trajectory.dcd step $stepsize first [expr [molinfo top get numframes] * $stepsize]
> Just wondering if there’s a way to add this as a keyword without having to recompile VMD? Something like:
> mol addfile trajectory.dcd step 5 fromlast
> Thanks,
> Tristan