Executes a command by parsing Python arguments and dispatching to the internal command execution system.
planetcnc.cmd_exec(cmd_id) planetcnc.cmd_exec(cmd_id, str) planetcnc.cmd_exec(cmd_id, val) planetcnc.cmd_exec(cmd_id, num, val) planetcnc.cmd_exec(cmd_id, num, val, val2)
* True, if command was executes successfully, otherwise False.
#! /usr/bin/env python import planetcnc # Open file open dialog id = planetcnc.cmd_get_id("File.Open_...") if not planetcnc.cmd_exec(id): print("Failed to execute command")
#! /usr/bin/env python import planetcnc # Open G-Code id = planetcnc.cmd_get_id("File.Open_Code") if not planetcnc.cmd_exec(id, "G00 X0 Y0\nG01 X20 Y0\nG01 X20 Y20\nG01 X0 Y20\nG01 X0 Y0"): print("Failed to execute command")
#! /usr/bin/env python import planetcnc # Open camera window id = planetcnc.cmd_get_id("Machine.Camera.Show") if not planetcnc.cmd_exec(id, 10000): print("Failed to execute command")
#! /usr/bin/env python import time import planetcnc # Set machine position id = planetcnc.cmd_get_id("Machine.Machine_Position.To_Value_...") if not planetcnc.cmd_exec(id, 0, 10): print("Failed to execute command") time.sleep(0.1) if not planetcnc.cmd_exec(id, 1, 20): print("Failed to execute command") time.sleep(0.1) if not planetcnc.cmd_exec(id, 2, 30): print("Failed to execute command")