Python coding help


#1

I was wondering if anyone could help me to write a python code that works with dobot magician, in order to draw a simple portrait? Thank you.


#2

Hi, if you want to draw something with python, you need no specify the movements where you want to move, and in the case of laser, you need to turn on or off when you need it.
For example:

def square():
	dType.SetPTPCmd(api, 2, 240.8322, 27.5039, -101.5051, 0, isQueued=1)
	dType.SetEndEffectorLaser(api, 1,  1, isQueued=1)
	dType.SetPTPCoordinateParams(api, 20, 20, 20,  0,  isQueued=1)
	dType.SetPTPCmd(api, 2, 276.5690, 29.5199, -101.5045, 0, isQueued=1)
	dType.SetPTPCmd(api, 2, 276.5690, -25.9682, -101.5039, 0, isQueued=1)
	dType.SetPTPCmd(api, 2, 240.6422, -25.9682, -101.5052, 0, isQueued=1)
	dType.SetPTPCmd(api, 2, 240.8322, 27.5039, -101.5051, 0, isQueued=1)
	dType.SetEndEffectorLaser(api, 0,  0, isQueued=1)

square()