From: Axel Kohlmeyer (
Date: Wed May 03 2006 - 10:29:29 CDT

On Wed, 3 May 2006, Enzo Vitale wrote:

EV> Dear VMD people,

dear enzo,

EV> I wrote some scripts (thanks for your previous very quick replies!)
EV> and now I would like to be able to call them from my local .vmdrc
EV> command files, without replicating them in each of these files.

VMD supports the standard tcl auto-loading mechanism for both packages
and individual subroutines.
please have a look at, e.g.

for three examples handling plugins, autoloaded subroutines and
vmd_XXX_subcommand extension scripts.

note that for autoloading, you need to create a tclIndex file. i usually
put the attached script into those directories and run it to update that

EV> The question is: where should I put the source of my subroutines in
EV> order for the TCL interpreter to find them automatically? Do I need to
EV> put each subroutine in a different source file (maybe with the same
EV> name as the subroutine)? And in which directory should these files be
EV> placed?
EV> I was not able to find an answer to this question in the (in any case
EV> excellent!) User's Guide.

you'd have to check out the tcl dokumentation for that.


p.s.: if you've written some useful stuff, please consider making
it available for the vmd script library. :)

EV> Thank you in advance,
EV> Enzo

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.

  • TEXT/PLAIN attachment: mkidx