Lego_loop [id two atoms] or [mol res1 res2]
Make a CA data base search for a zone but only use atoms that have been selected with Select_on or Select_off. After accepting coordinates, the selection datablock is not changed so sometime remember to use Select_on again. Otherwise, when you eventually write out the coordinates you might not get what you expected.
Example: insert an extra residue into a molecule called a28 after residue 100. Use the databases to construct main and side chain coordinates
mutate_insert a28 100 100a leu ; sel_on a28 ; sel_off a28 100 101 lego_loop a28 98 103 yes sel_on a28 ; leg_side a28 100 yes
The loop chosen is the best fit to the CA coordinates of residues 98, 99, 102, and 103. The new leucine residue has the most common rotamer conformation.