Urscript move single joint angle of a specific angle instead of set coordinate position

Hi all,
I would like write a script in ur16 to change joint angle instead of set x y x rx ry rz. it is possible? for example I would like rotate last wrist of 180°. it is possible using urscript?
many thanks in advance
best regards

Here’s a script I wrote a while ago for a UR5e – I’m assuming I tested it and it worked . . . . .

It lets you rotate a specified joint TO a specified angle:

def move_joint(joint_num, angle_deg):

global move_pos= get_actual_joint_positions()
angle_rad = angle_deg*3.14159/180
move_pos[joint_num]=angle_rad
movej(move_pos, a=0.5, v=0.4)

end

By changing the angle definition slightly, this should let you change the angle of a specified joint BY a specified angle:

def move_joint(joint_num, angle_deg):

global move_pos= get_actual_joint_positions()
angle_rad = move_pos[joint_num] + angle_deg*3.14159/180
move_pos[joint_num]=angle_rad
movej(move_pos, a=0.5, v=0.4)

end