Variable in SheetCAM TNG

Hello,

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

Greetings

Robert

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:

;HEADER:
;SHEETCAM PP HEIDENHAIN TNC
;DRAWING: VariableDrawing
;DATE: 30.03.2011
;CREATOR: VariableCreator
;WORKPIECE: partName
;
;PROGRAM:

Operation1
.
Operation2

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!


Greetings


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: