Here is what I got. It'll only work if you save your toolpath before you change to the next sheet. That is because it gets the name of your current sheet.
Create a copy of your post processor first
Then copy the script section and insert it into the POST_NAME area like this example
Code: Select all
POST_NAME = "Grbl Sheet (mm) (*.gcode)"
+TAPE_SPLITTING = 55000 5000 "%s_%d.gcode" 1 "YES"
FILE_EXTENSION = "gcode"
UNITS = "MM"
LASER_SUPPORT = "YES"
RAPID_PLUNGE_TO_STARTZ = YES
+DIRECT_OUTPUT = "VTransfer"
SUBSTITUTE = "({)}"
+ Script to build a line like below
+ "([TP_FILENAME] - [SHEET_NAME]/[TOOLPATH_NAME])"
SCRIPT
require "strict"
pp = require "ppVariables"
function main(script_path)
if pp.Init() == false then
DisplayMessageBox('Failed to initialise ppVariables module!')
return false
end
return true
end
function get_sheet()
local job = VectricJob()
local sheet_manager = job.SheetManager
local sheet_id = sheet_manager.ActiveSheetId
local sheet_name = sheet_manager:GetSheetName(sheet_id)
return sheet_name
end
function lua_header()
-- Format a line like below
-- "([TP_FILENAME] - [SHEET_NAME]/[TOOLPATH_NAME])"
local sheet_name = {}
sheet_name = get_sheet()
local tp_filename = {}
tp_filename = pp.TP_FILENAME
local tp_name = {}
tp_name = pp.TOOLPATH_NAME
pp.PostP:OutputLine('(' .. tp_filename .. ' - ' .. sheet_name .. '/' .. tp_name .. ')\r\n', false)
end
ENDSCRIPT
Then wherever you want the line displayed in the gcode insert this line. In this example it's the first line on the Header section
The resulting line of Gcode is
(Test V5TP - Sheet 1/Test V5)