How to change a mate in API

Hello,

I have bizzare mate error situation. I have working on an assembly which has a distance mate. While updating the assembly through api, distance mate gives error. But if i manually change the distance mate to parallell and then again click on ditance mate then it goes back to it's required position with out giving any error.

After going through lot of search i found the bug is in solidworks. Now i m stuck as my running api will creating error in assembly.

So if any one know the code to change mate from ditance to parallell and then again to distance it will be help full. I know it is not the correct method to do the programming but right now it seems ok.

Regards

Devi

SolidworksApi macros