RobotStudio event

Set workobject and tool in jogging window using RAPID.

Is there a command that sets the workobject and tool using RAPID?

the problem I am having is; I have a routine that contains all my robtargets in a list of MoveL commands, I use this routine to teach the robtargets. There ia a variety of tools and workobjects used, meaning if I ModPos one position with toolA I cant mod pos another position with toolB, untill I switch to the jogging window, change the tool and switch back.

 

I dont want to do all this switching back and forth on the teach pendant. I kind of want my code to look like this.

 


!### Set tool as t1        ###
!### and Work object as wA ###
!### by using RAPID here   ###
    MoveL pA10,v100,z1,t1\WObj:=wA;
    MoveL pA20,v100,z1,t1\WObj:=wA;
   
!### Set tool as t1        ###
!### and Work object as wB ###
!### by using RAPID here   ###
    MoveL pB10,v100,z1,t1\WObj:=wB;
    MoveL pB20,v100,z1,t1\WObj:=wB;
   
!### Set tool as t2      ###
!### by using RAPID here ###
    MoveL p10,v100,z1,t2;
   
!### Set tool as t3      ###
!### by using RAPID here ###
    MoveL p20,v100,z1,t3;