Variable in SheetCAM TNG


how can I create a variable like “plungeRate” or “date” to use it in the “function OnInit()”?



What exactly do you want to do with this variable?

I want to fill in variables like “Drawing:” or “Processing step:” in the post.
I use the variables “date” and “partName”, that works.

When i use the operation-variables in the “function OnInit()” i must run the postprocessor a second time. In the first step the variables are always “nil” or the entry is the same as before.

You can’t use the operation variables in OnInit() because OnInit() runs before the operation is executed. function OnNewOperation() runs immediately after the operation variables are defined. Can you move your code to that function?

No, I want the variables in the header of the program.

For example:

;DRAWING: VariableDrawing
;DATE: 30.03.2011
;CREATOR: VariableCreator
;WORKPIECE: partName


and so on

I am afraid you can’t do that. OnInit has no way of knowing how many operations there are and it has no access to the operation data.

Is there any way to do this with a lua plugin?

Not at the moment. I will be giving the Lua plugins access to operation and tool data but it won’t be for a couple of months.

Okay, thank you!


Robert from Good Old Germany

Hi Les,
Can you help me to use the variable in Lua plugin? I try to use cmt " var.MaterialThickness" in Mach plugin. But it have a error " index global " var" a nil value .

sorry , my English skill’s not good :slight_smile: