From: Roni Saiba (ronis_at_imsc.res.in)
Date: Fri Apr 19 2024 - 22:05:43 CDT

Hi,

molid is not a command. You have to put the specific molecule number
instead of "molid $sel". The modified script may look something like
this:

Quoting CHARLES MCCALLUM <cmccallum_at_me.com>:
set velid [mol new file.psf]
set trajid [mol new file.psf]
set molnum2 [molinfo index $trajid]
mol addfile file.dcd type dcd waitfor all $trajid

Regards,
Roni

> We are trying to do an analysis in a tcl script, and I’m a bit
> confused as to how VMD acts versus how the VMD tcl command
> documentation suggests. I want to load the veldcd and regular dcd
> into two separate molids, but with the same psf:
>
> set velid [mol new file.psf] ;# molid “0” for example
> set trajid [mol new file.psf];# molid “1” for example
> mol addfile file.veldcd type dcd waitfor all molid $velid
> mol addfile file.dcd type dcd waitfor all molid $trajid
>
> I would expect that adding the ‘molid $velid’ forces the veldcd to
> to into the molid 0, that is, the velocity dcd. But it always adds
> into the second molid (the top molid).
>
> We work around this by always ‘mol addfile…’ after each new molid
> while it is the top:
>
> set velid [mol new file.psf] ;# molid “0” for example
> mol addfile file.veldcd type dcd waitfor all molid $velid
> set trajid [mol new file.psf];# molid “1” for example
> mol addfile file.dcd type dcd waitfor all molid $trajid
>
> Or, we can explicitly set whichever one we want as the top with ‘mol
> top $velid’. But it makes me wonder why it doesn’t work in the
> first set of commands; the ‘molid $velid’ seems to be ignored. We
> have tried this with actual numbers instead of variables. In other
> words, the variables representing the molids are being set
> correctly. When I make selections for the calculation later on,
> setting the molid that I want (velocities or coordinates) works as
> expected with ‘atomselect’. Clearly I’m missing something here.
>
> Thanks
> Mike
>
> --
> C. Michael McCallum
> Professor
> Department of Chemistry, UOP
> mmccallum .at. pacific .dot. edu (209) 946-2636 v /
> (209) 946-2607 fax