set A_all [atomselect top all]
set N [$A_all num]

for {set i 1} {$i <= $N} {incr i} {
  set A [atomselect top "serial $i"]
  $A set beta [expr $i * 1.0]
  $A delete
}

$A_all writepdb cg_monomer-beta.pdb
$A_all delete