Match and set same torsion angle in a set of structures

I was working with a set of structures in a study table recently and I realized that the torsion angles for the carboxyl groups in all the structures were wrong. I wanted to modify them all but had about 30 structures. I remembered that we exposed FindPatterns in Materials Studio 5.5 and I could use this to match and set the torsion angles so of course I wrote a script to do it.....

This only works for torsion angles but could easily be modified to do distances or bond angles. A pattern document and study table are required as input. The study table should have a structure in each row.

Modules: Materials Visualizer

Materials Studio Version: 5.5

Have fun.

Cheers

Stephen