I am trying to change a particular dihedral for a known set of coordinates by editing the IC. The IC changes but coordinate remains the same.
I could not figure out the mistake in following code.

stream toppar.str
stream @str
set residue @resi

read sequence @resi 1
generate @resi first none last none setup warn

read coor card name @resicrd

ic fill ! preserve

set value -180

label repeat
ic edit
  dihedral 1 N1 1 C3 1 C4 1 C5 @value
ic print
coor init sele (type N1 .or. type C3 or. type C4 .or. type C5) end
ic build

open unit 30 write form name @resi_@value.pdb
write coor pdb unit 30
close unit 30
incr value by 15
if @value eq 180 then
   goto repeat