From: Ajasja Ljubetič (
Date: Wed Feb 16 2011 - 03:00:01 CST

Hi Hao,

I use VMDs orient<>plugin
to align my system along a certain axis. Unless I'm missing
something, it should not mater if you align the axis along the vector or the
vector to the axis.
The orient command should be able to do this. Use it like this
"orient *selection* *vector-to-align* *target-axis"*

best regards,

Below is a full example:

#load some plugins
lappend auto_path {E:\Projekti\VMD\Principal_axes\la1.0}
lappend auto_path {E:\Projekti\VMD\Principal_axes\orient}

package require Orient
namespace import Orient::orient

#load the peptide
set protmol [mol load pdb A35_raw.pdb]
set prot [atomselect $protmol protein]

#center the protein
$prot moveby [vecinvert [measure center $prot]]

#align the principle axis to the z axis
set I [Orient::calc_principalaxes $prot];
#orietn z
set A [orient $prot [lindex $I 2] {0 0 1}]
$prot move $A
set I [Orient::calc_principalaxes $prot]
#orient x
set A [orient $prot [lindex $I 1] {0 1 0}]
$prot move $A
#set I [draw principalaxes $prot]

#graphics $protmol delete all

$prot writepdb L35.pdb

On Tue, Feb 15, 2011 at 21:39, dhacademic <> wrote:

> Hi all,
> The "transvec" can be used to bring the x-axis along a new vector V. I want
> to know how to bring y-axis (or z-axis) to a new vector V. Many thanks.
> Best,
> Hao