Default tools textfile querie

Having problems with or questions about SheetCam? Post them here.
Post Reply
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

Default tools textfile querie

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

Post 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.
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

Post by mancavedweller »

Great, thanks very much Les.

Keith.
Post Reply