Hello Guest it is December 13, 2019, 06:08:49 AM

Author Topic: Tool Number read from Mach's Tool Table?  (Read 14964 times)

0 Members and 1 Guest are viewing this topic.

Re: Tool Number read from Mach's Tool Table?
« Reply #20 on: March 10, 2008, 11:53:32 PM »
Just a little add onto this thread:

' append to file = C:\Mach3\macros\toolinfo.txt
 
N = GetToolDesc(1)
D = GetToolParam(1,1)
L = GetToolParam(1,2)

textFilePath = "C:\mach3\macros\toolinfo.txt"

Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.opentextfile(textFilePath,ForAppending)

objTextFile.WriteLine("Tool1: " & N &" Diameter: "& D  &" Length: " & L)

objTextFile.Close

'End

'Now to learn how to scroll through the tool table (until there are no more descriptions) and overwrite the text file.

'Put it all in a button and I can "export" the info.

'I'm just wanting a tool information cheat sheet to take back to my desk while I fiddle with the CAM.

'All suggestions graciously accepted.
« Last Edit: March 11, 2008, 09:58:37 PM by keithorr »
"If you tell a lie big enough and keep repeating it, people will eventually come to believe it." - Joseph Goebels
Re: Tool Number read from Mach's Tool Table?
« Reply #21 on: March 11, 2008, 02:04:55 AM »
This reads information from the tooldata file and overwrites a text file up to 100 tools
Stops writing with the first instance of "Empty" as a tool description

////'PLEASE BE SURE YOU UNDERSTAND WHAT YOU'RE DOING WITH THIS FILE OR ELSE JUST WALK AWAY/////

'Create a New Button on a Screen using the Mach3Screen.exe.
'(Load the screen set you usually use) I placed one on the Offsets Screen for my use. You may have a better location.

'Paste the text below into the VB window of the Button Properties Screen
'The new button will create and update a text file on your desktop showing tool information up to 100 tools.
'Useful to have when your CAD/CAM is on another PC.


' overwrite file = C:\Documents and Settings\All Users\Desktop\ToolInfo.txt

textFilePath = "C:\Documents and Settings\All Users\Desktop\ToolInfo.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(textFilePath)


Do Until num=100

num=num+1

N = GetToolDesc(num)
D = GetToolParam(num,1)
L = GetToolParam(num,2)

objTextFile.WriteLine("Tool"& num &" "& N &" Diameter: "& D &" Length: "& L & Chr(13) & Chr(10))

If N ="Empty" Then num = 100



Loop

objTextFile.Close

'End
« Last Edit: March 11, 2008, 09:58:53 PM by keithorr »
"If you tell a lie big enough and keep repeating it, people will eventually come to believe it." - Joseph Goebels
Re: Tool Number read from Mach's Tool Table?
« Reply #22 on: March 11, 2008, 03:33:48 PM »
newer version will poll up to 225 tools and skip any tool with a description of "empty"

' overwrite file = C:\Documents and Settings\All Users\Desktop\ToolInfo.txt

textFilePath = "C:\Documents and Settings\All Users\Desktop\ToolInfo.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(textFilePath)


Do Until num=225

num=num+1

N = GetToolDesc(num)
D = GetToolParam(num,1)
L = GetToolParam(num,2)

If N <>"Empty" Then

objTextFile.WriteLine("Tool"& num &" "& N &" Diameter: "& D &" Length: "& L & Chr(13) & Chr(10))

Else

End If

Loop

objTextFile.Close

'End
« Last Edit: March 11, 2008, 09:58:15 PM by keithorr »
"If you tell a lie big enough and keep repeating it, people will eventually come to believe it." - Joseph Goebels

Offline zealous

*
  •  492 492
  • HI!
    • View Profile
    • Artsoft Solutions
Re: Tool Number read from Mach's Tool Table?
« Reply #23 on: March 21, 2008, 08:41:31 AM »
thanks Keith very helpful and nice way to do it :)

vmax549

*
Re: Tool Number read from Mach's Tool Table?
« Reply #24 on: March 23, 2008, 12:12:48 AM »
Keith thanks for the macro, I have asked Art in the past for such a thing. It is extremely handy to have the tool table handy when you are3 working in cad or just loading up a tool carousel for a job.

You may want to consider posting all parameters of each tool to the file. the tool may measure say .375 but actually cut.3765, so the wear diam are very important also. We use them to setup the exact cutting diam if known.

(;-) TP

vmax549

*
Re: Tool Number read from Mach's Tool Table?
« Reply #25 on: March 25, 2008, 09:07:30 PM »
HI  Keithorr, WOuld it be possible to  have the utility write to a LPT port to print the tool table??? It would be nice to make sure the toolbook was current.\

(;-) TP