From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Jan 03 2007 - 10:23:46 CST

Hi,
  Your script has a couple of issues, as currently written..
You've hard coded the molecule you're referencing as "0", but if
you load multiple files this will not necessarily give you the
correct result. You'll be better off either adding the molid as
a second parameter to your proc, or to use "top" rather than "0".
The second issue with this script is using "animate goto", which is
ok, but you would need to also use "display update ui" to force an
update since you're not otherwise doing anything graphical in the
script. The better way to do this is with the command:
  molinfo top set frame $i

Here's an improved (and correctly operating) version of your script:

proc box { molid file } {
  set fout [open $file w]
  set nf [molinfo $molid get numframes]

  for { set i 0 } { $i < $nf } { incr i } {
    molinfo $molid set frame $i
    puts $fout "[expr ($i+1.0)/1000.0] [molinfo $molid get {a b c}]"
  }
  close $fout
}

To run it, you'd do something like:
  box top /tmp/boxinfo.txt

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Fri, Dec 22, 2006 at 06:24:19PM -0500, Myunggi Yi wrote:
> Dear vmd users,
>
> I'm extracting the box information from amber trajectory
> with parm7 and crdbox format.
>
> When I use the following script,
> I've got the constant box information.
> Since I used constant pressure, this result is wrong.
>
>
> proc box { file } {
> set fout [open $file w]
> set nf [molinfo 0 get numframes]
>
> for { set i 0 } { $i < $nf } { incr i } {
> animate goto $i
> puts $fout "[expr ($i+1.0)/1000.0] [molinfo 0 get {a b c}]"
> }
> close $fout
> }
>
>
> Anything wrong in my script?
>
>
>
> --
> Best wishes,
>
> MYUNGGI YI

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078