Page 1 of 1

Lathe tooltable variables

PostPosted: Tue Jun 24, 2025 9:04 am
by Delco
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) + "]");

Re: Lathe tooltable variables

PostPosted: Wed Jun 25, 2025 1:45 pm
by cncdrive
OK, but what is the issue, is your code not working?