Page 1 of 1

Default tools textfile querie

Posted: Sat Sep 02, 2017 9:07 am
by mancavedweller
Hi Les,

I'm doing a little programming that involves reading (only reading) the default tools text file "Default.tools" in the appdata folder.

Here's a simple tool file containing 2 tools:

[Tool0]
Type=PlasmaTool
Name=Steel 3mm Finecut @ 45A
Comment=
Tool\ number=7
Kerf\ width=1.5
Plunge\ rate=3810
Pierce\ delay=0.5
Pause\ at\ end\ of\ cut=0
Wiggle\ length=10
Pierce\ height=3.81
Cut\ height=1.524
Pierce\ type=0
Feed\ rate=2540
[Tool1]
Type=PlasmaTool
Name=Steel 5mm 45A nozzle
Comment=
Tool\ number=8
Kerf\ width=1.5
Plunge\ rate=3810
Pierce\ delay=0.5
Pause\ at\ end\ of\ cut=0
Wiggle\ length=10
Pierce\ height=3.8
Cut\ height=1.5
Pierce\ type=0
Feed\ rate=1500

I'm looking at reading this file in a sequential manner, i.e. I'm EXPECTING the sequence will always be:

[ToolX]
Type=
Name=
Comment=

etc, etc.

My program is only interested in plasma tools and will ignore any other tools. Will Sheetcam ever change the ordering of lines in a plasma tool, OR would any extra lines ever get added into a plasma tool by Sheetcam.

I could always test each line for "[ToolX]" but after that point I'm basically wondering if I have to test each line for "Type=", "Name=", etc or can I rely on the fixed sequence of the lines to always be the same.

Thanks,

Keith.

Posted: Mon Sep 04, 2017 9:24 am
by Les Newell
The tools are always output in order although SheetCam doesn't require them to be in order when it reads the file. The contents of each tool again should always be output in order though SheetCam doesn't actually care about the order.
Extra lines can be added by post processors that add extra tool parameters.

I would recommend testing each line to find the data you are interested in. It is likely to be a more robust solution.

Posted: Mon Sep 04, 2017 6:56 pm
by mancavedweller
Great, thanks very much Les.

Keith.