Automatic part import and mate

Alright I need some help on this one.

Is there a way to write a Macro/Code to automatically import partsinto an assembly and have the part snap to a mate reference alreadyset up?

I wrote a macro to bring the part in but for some reason it doesn'tsnap to the mate reference.

Please help.SolidworksApi macros