Page 1 of 1

Variable in SheetCAM TNG

Posted: Mon Mar 28, 2011 3:53 pm
by Zwackelmann
Hello,

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

Greetings

Robert

Posted: Tue Mar 29, 2011 9:28 am
by Les Newell
What exactly do you want to do with this variable?

Posted: Wed Mar 30, 2011 4:58 am
by Zwackelmann
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.

Posted: Wed Mar 30, 2011 9:15 am
by Les Newell
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?

Posted: Wed Mar 30, 2011 10:59 am
by Zwackelmann
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

Posted: Wed Mar 30, 2011 11:24 am
by Les Newell
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.

Posted: Thu Mar 31, 2011 2:20 pm
by Zwackelmann
Is there any way to do this with a lua plugin?

Posted: Thu Mar 31, 2011 2:25 pm
by Les Newell
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.

Posted: Fri Apr 01, 2011 10:53 am
by Zwackelmann
Okay, thank you!


Greetings


Robert from Good Old Germany

Posted: Wed Apr 05, 2017 8:13 am
by hoangnhatng
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 :)