Variable in SheetCAM TNG

Having problems with or questions about SheetCam? Post them here.
Post Reply
Zwackelmann

Variable in SheetCAM TNG

Post by Zwackelmann »

Hello,

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

Greetings

Robert
User avatar
Les Newell
Site Admin
Posts: 3665
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

What exactly do you want to do with this variable?
Zwackelmann

Post 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.
User avatar
Les Newell
Site Admin
Posts: 3665
Joined: Thu May 11, 2006 8:12 pm

Post 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?
Zwackelmann

Post 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
User avatar
Les Newell
Site Admin
Posts: 3665
Joined: Thu May 11, 2006 8:12 pm

Post 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.
Zwackelmann

Post by Zwackelmann »

Is there any way to do this with a lua plugin?
User avatar
Les Newell
Site Admin
Posts: 3665
Joined: Thu May 11, 2006 8:12 pm

Post 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.
Zwackelmann

Post by Zwackelmann »

Okay, thank you!


Greetings


Robert from Good Old Germany
hoangnhatng
Posts: 7
Joined: Wed Apr 05, 2017 4:59 am

Post 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 :)
Post Reply