Move Robot in Solidworks

Hi,

i try to code a macro which can move the head of a robot regarding its coordinate system. Thats what i already tried...

- I tried to modify "transforms2", but the assembly always jumps back to its old possition after modifying.  ---- reason, i use "min-Max" mates and the values doesnt automaticaly change...

- To solve this problem i supressed all "min-Max" mates of the joints so the components dont jump back into the old position. Then i fixed the Head of the Robot and unsupressed the "min-Max"mates. ---- this works sometimes, but most the time the mates crash....  ---- reason: when i move the head regarding its own coordinate system it sometimes moves into positions that cant be achieved by the axis of the robot....

I have no idea how i can solve this problem.... does any one has a idea what i could do next?!

Thx

SolidworksApi macros