Adds one or more G-code lines to the program's G-code list.
The function takes a variable number of arguments (which are converted to a single string) and splits it into individual G-code lines.
It then attempts to add each line to the G-code line list.
planetcnc.gcode_line_add(args)
#! /usr/bin/env python import planetcnc # Add G-code lines from a single string. # Each line should be separated by a newline character. result = planetcnc.gcode_line_add("G00 X10 Y10\nG01 X20 Y20\n") if result: print("G-code lines added successfully.") planetcnc.gcode_open() else: print("Failed to add some G-code lines.")