From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Wed Sep 17 2008 - 22:39:40 CDT

There's a function in the molefacture source code to do this; if you
navigate to the vmd plugins directory and look in
molefacture_builder.tcl for the proc set_dihedral. I've reproduced it
below.You need to have a selection for the atoms to move; this is
generally done in molefacture using the ::util::bondedsel function from
the utilities plugin to recursively construct a set of all atoms
attached to one side of the rotating bond.
Best,
Peter

proc ::Molefacture::set_dihedral {movesel newval ind1 ind2 ind3 ind4} {
# Acting on atoms in tmpmolid, move the selection movesel such that
# the dihedral formed by the input atom indices is $newval
  variable tmpmolid

# Validate input
  if {$ind1 == "" || $ind2 == "" || $ind3 == "" || $ind4 == ""} {
    puts "WARNING: Couldn't find one or more atoms for set_dihedral"
    return
  }

  set dihedral [measure dihed [list [list $ind1 $tmpmolid] [list $ind2
$tmpmolid] [list $ind3 $tmpmolid] [list $ind4 $tmpmolid] ]]

  set bsel1 [atomselect $tmpmolid "index $ind2"]
  set bsel2 [atomselect $tmpmolid "index $ind3"]

  set delta [expr -1 * ($dihedral - $newval)]
  set mat [trans bond [lindex [$bsel1 get {x y z}] 0] [lindex [$bsel2
get {x y z}] 0] $delta deg]
  $movesel move $mat

  $bsel1 delete
  $bsel2 delete
}

John Stone wrote:
> Hi,
> There's not a built-in command for this, but you could probably
> write a short Tcl script to do it for you. There might be existing
> scripts or code floating around that I'm not aware of, if someone else
> has something, please speak up.
>
> Cheers,
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Wed, Sep 17, 2008 at 08:56:17AM +0530, jani sahil wrote:
>
>> Dear All,
>> It is possible to change psi diherdal by set command
>> but is their any command similar to set psi so which can be applied to dihed
>> also
>> I mean to sy set dihed {atom1 atom2 atom3 atom4} and followed by particular
>> value od diherdal which we want
>> to set.
>>
>> please suggest me in this regards
>>
>>
>> Jani Sahil
>> CDAC
>> INDIA
>>
>
>