How calculate bonds with resonant representation (script)?

Hi Evereyone,

I have two simple questions:

1 - How can I calculate bonds in a xsd file (using script in the Materials Studio) with the resonant representation? I know do that using the graphic interface, but I have to use a script because I have to do the same thing for a lot of structures.

2 - How can I find out the Chain that some residue or atom belongs? (using script too)

Thanks,

Pablo