From: Axel Kohlmeyer (
Date: Thu Jun 26 2014 - 06:43:17 CDT

I recommend against using swig. It uses an outdated and sometimes
problematic way to do the wrapper. Writing a plugin manually is so simple
and well explained in the tcl documentation, there is little need for it

The plugin source tree of vmd has many examples.

On Jun 26, 2014 7:38 AM, "Shailesh Pandey" <> wrote:
> Dear Rohan,
> Yes, It is possible, you will have to make your c program a library,
main() function is to be removed and then you can interface it with TCL
using SWIG, please look into swig tutorial
> here:
> If abstract (including core functions, and how they are used in program)
layout of C program would have been provided, little more detailing could
have been possible.
> Good luck.
> On Thu, Jun 26, 2014 at 3:08 PM, Rohan Mehta <>
>> Hello everyone!
>> I have made a C-code to count number of trimers, tetramers,..., n-mers
etc. for a water-system. I have considered dimers as building blocks for
any such n-mer. My program of getting dimer-pairs is written in Tcl.
However, the program to count n-mers is written in C (mainly because it
involves use of Graph Theory). Therefore I am not able to make a Tcl script
that can be used in VMD.
>> Is there any way we can bridge/patch C programs with Tcl shell of VMD?
In other words, is there any way we can run the C program for VMD?
>> Thanks in advance.
>> Sincerely,
>> Rohan Mehta.
>> --
>> 3rd Year Undergraduate Student
>> Integrated M.Sc.(Hons.) Physics + B.E.(Hons.) Electrical and Electronics
>> Birla Institute of Technology and Science (BITS) - Pilani, Pilani Campus
>> Phone: +91 8058437073
>> E-Mail:
>> Web: