Quantcast
Channel: Active questions tagged vmd - Stack Overflow
Viewing all articles
Browse latest Browse all 33

Difference tcl script tkconsole to load gro file in VMD

$
0
0

My problem is simple: I'm trying to write a tcl script to use $grofile instead writing every time I need this file name.So, what I did in TkConsole was:

% set grofile "file.gro"% mol load gro ${grofile}

and, indeed, I succeeded uploading the file.In the script I have the same lines, but still have this error:

wrong # args: should be "set varName ?newValue?"

can't read "grofile": no such variable

I tried to solve my problem with

% set grofile [./file.gro]

and I have this error,

invalid command name "./file.gro"

can't read "grofile": no such variable

I tried also with

% set grofile [file ./file.gro r]

and I got the first error, again.

I haven't found any simple way to avoid using the explicit name of the file I want to upload. It seems like you only can use the most trivial, but tedious way:

mol load file.gromol addfile file.xtc

and so on and so on...

Can you help me with a brief explanation about why in the TkConsole I can upload the file and use it as a variable while I can not in the tcl script?Also, if you have where is my mistake, I will appreciate it.

I apologize if it is basic, but I could not find any answer. Thanks.

I add the head of my script:

set grofile "sim.part0001_protein_lipid.gro"set xtcfile "protein_lipid.xtc"set intime  "0-5ms"set system  "lower"source view_change_render.tclsource cg_bonds.tclmol load gro $grofile xtc ${system}_${intime}_${xtcfile}

It was solved, thanks for your help.


Viewing all articles
Browse latest Browse all 33

Trending Articles