Lathe tooltable variables

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Lathe tooltable variables

Postby Delco » Tue Jun 24, 2025 9:04 am

I am trying to read the tool type for a m31 macro to probe for tool X and Z offset.

I have this snippet of code trying to read the tool type field as I do on my mill but it must be different.
/// M200 - Debug Tool Type Macro
/// Displays current tool number and its Type field value from tool table.
/// </summary>

int toolNum = exec.Getcurrenttool();
if (toolNum < 1 || toolNum > 96) {
exec.AddStatusmessage("M200: Invalid or no tool selected.");
return;
}

string toolType = exec.Readkey("Tooltablevalues", "Type" + toolNum, "");
exec.AddStatusmessage("M200: Tool T" + toolNum + " Type = '" + toolType + "'");

var typeFlags = toolType.Split(new char[] { ' ', ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
exec.AddStatusmessage("M200: Parsed flags: [" + string.Join(", ", typeFlags) + "]");
Delco
 
Posts: 391
Joined: Tue Apr 02, 2019 4:23 am

Re: Lathe tooltable variables

Postby cncdrive » Wed Jun 25, 2025 1:45 pm

OK, but what is the issue, is your code not working?
cncdrive
Site Admin
 
Posts: 5197
Joined: Tue Aug 12, 2014 11:17 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 2 guests