From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Mon Apr 22 2013 - 02:48:33 CDT

On Mon, Apr 22, 2013 at 8:39 AM, Albert <mailmd2011_at_gmail.com> wrote:
> Hello:
>
> I am trying to run pbc command in a python script:
>
>
> import sys
> from atomsel import atomsel
> from Molecule import Molecule
> from VMD import evaltcl
>
> evaltcl('pbc wrap -compound residue -center com -centersel protein -all')
>
>
> with command:
>
> vmd2 P-in.cms all.dtr -python -dispdev text -e my.py
>
>
> but it always failed with messages:
>
>
>
> Traceback (most recent call last):
> File "VMD", line 10, in <module>
> File "/soft/vmd-1.9.1.src/vmd-1.9.1/lib/vmd/scripts/python/VMD.py", line
> 92, in evaltcl
> return VMDevaltcl(args)
> ValueError: invalid command name "pbc"

yes. you didn't "require" the pbctools package. in textmode none of
the add-on packages are loaded into VMD's Tcl interpreter, you you'd
need to use "package require" to load them. (in graphical mode many
packages including pbctools are loaded because they are "required" by
the various Extension GUIs).

axel.

>
>
> thank you very much
> Albert
>
>

--
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
International Centre for Theoretical Physics, Trieste. Italy.