@@ -0,0 +1,1923 @@
+import os%0Aimport sys%0Alib_path = os.path.abspath('../')%0Asys.path.append(lib_path)%0Aimport makerbot_driver%0A%0Aimport serial%0Aimport serial.tools.list_ports as lp%0Aimport optparse%0A%0Aparser = optparse.OptionParser()%0Aparser.add_option(%22-i%22, %22--inputfile%22, dest=%22input_file%22,%0A                  help=%22gcode file to read in%22, default=False)%0Aparser.add_option(%22-o%22, %22--outputfile%22, dest=%22output_file%22,%0A                  help=%22s3g file to write out%22, default=False)%0Aparser.add_option(%22-s%22, %22--sequences%22, dest=%22sequences%22,%0A                  help=%22Flag to not use makerbot_driver's start/end sequences%22,%0A                  default=True, action=%22store_false%22)%0Aparser.add_option(%22-m%22, %22--machine_type%22, dest=%22machine%22,%0A                  help=%22machine type%22, default=%22ReplicatorDual%22)%0A(options, args) = parser.parse_args()%0A%0Aparser = makerbot_driver.create_print_to_file_parser(options.output_file, 'TOMStepstruderSingle', legacy=True)%0A%0Aassembler = makerbot_driver.GcodeAssembler(parser.state.profile)%0Astart, end, variables = assembler.assemble_recipe(%0A    material='ABS',%0A    begin_print='tom_begin',%0A    homing='tom_homing',%0A    start_position='tom_start_position',%0A    end_start_sequence='tom_end_start_sequence',%0A    end_position='tom_end_position',%0A    end_print='tom_end',%0A)%0Astart_gcode = assembler.assemble_start_sequence(start)%0Aend_gcode = assembler.assemble_end_sequence(end)%0A%0Afilename = os.path.basename(options.input_file)%0Afilename = os.path.splitext(filename)%5B0%5D%0A%0Aparser.environment.update(variables)%0Aparser.state.values%5B%22build_name%22%5D = filename%5B:15%5D%0A%0Aparser.s3g.print_to_file_type = %5B'x3g'%5D%0A%0Aparser.s3g.clear_buffer()%0Aparser.s3g.reset()%0Aif options.sequences:%0A    for line in start_gcode:%0A        parser.execute_line(line)%0Awith open(options.input_file) as f:%0A    for line in f:%0A        print line%0A        parser.execute_line(line)%0Aif options.sequences:%0A    for line in end_gcode:%0A        print line%0A        parser.execute_line(line)%0A

Legacy Converty to Gcode