VMD-L Mailing List
From: Robert Brunner (rbrunner_at_uiuc.edu)
Date: Fri Jun 08 2007 - 14:55:20 CDT
- Next message: Cesar Millan: "use animatepdbs.tcl to include APBS potential maps"
- Previous message: Moumita Maiti: "rmsd calculation for RNA"
- In reply to: Pavan Ghatty: "Simple TCL/Tk question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
[$h12 get {x y z}] returns a list of lists (since the selection may
have included more than one atom), so you need to do
set vector [lindex [$h12 get {x y z}] 0]
When you do foreach, it does the unwrapping and executes one
iteration of the loop, so it is also correct.
Robert
On Jun 8, 2007, at 11:04 AM, Pavan Ghatty wrote:
> Hello all,
>
> I loaded a pdb file on vmd and typed the following commands on the
> Tcl/Tk console:
>
> set h12 [atomselect top "serial 6"]
>
> set vector [$h12 get {x y z}]
>
> veclength $vector
>
> That is what I want to do but Tcl keeps complaining that $vector is
> non-numeric. How else should I load the coordinates of h12 in to a
> vector without using foreach.
> This worked
> foreach coord [$h12 get {x y z}] {
> puts [veclength $coord]
> }
>
> Thanks.
> Pavan
- application/pgp-signature attachment: This is a digitally signed message part
- Next message: Cesar Millan: "use animatepdbs.tcl to include APBS potential maps"
- Previous message: Moumita Maiti: "rmsd calculation for RNA"
- In reply to: Pavan Ghatty: "Simple TCL/Tk question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]