Remove fixed and add mate

There are many fixed parts in the assembly,Is there any way to remove the fixed and add mate  in batch by api

SolidworksApi/macros