Machsupport Forum

Support => Downloads => MACH TOOL BOX => Topic started by: vmax549 on March 27, 2009, 08:38:57 PM

Title: MACRO , Tool Table Report
Post by: vmax549 on March 27, 2009, 08:38:57 PM
Here is a macro to scan the tool table file and print it out to the local printer. It also write a file copy to the Mach directory called ToolTableReport that can be read from notebook.

You can run it from a button or the MDI

Code Example:

'Macro ToolTable Report
'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:\mach3\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)
WD= Gettoolparam(num,3)
WL= Gettoolparam(num,4)
If N <>"Empty" Then
objTextFile.WriteLine("*Tool"& num &"  * "& N &" *Diameter: "& D &" *Length: "& L &" *Wear Diam"&WD &" *WearLength"&WL & Chr(13) & Chr(10))
Else
End If
Loop
objTextFile.Close
Dim sCOMMAND As String
 sCOMMAND="print c:\mach3\toolinfo.txt"
 Shell("c:\winnt2\system32\cmd.exe /c" & sCOMMAND)
End   
Title: Re: MACRO , Tool Table Report
Post by: Chip on July 13, 2009, 11:56:32 PM
Hi Terry

Thanks for sharing all these M1S files, It gives us allot of good examples to work with and put to use.

I see on this one you've used the name ToolTableReport,m1s, Is this allowed in the Mach3 Rev. 4 your testing ?.

Hopping it is and maybe some day some of us will get a Look at it Hear.

Thanks, Chip
Title: Re: MACRO , Tool Table Report
Post by: keithorr on August 04, 2009, 01:20:17 PM
Here is a macro to scan the tool table file and print it out to the local printer. It also write a file copy to the Mach directory called ToolTableReport that can be read from notebook.

You can run it from a button or the MDI

Code Example:

'Macro ToolTable Report
'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:\mach3\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)
WD= Gettoolparam(num,3)
WL= Gettoolparam(num,4)
If N <>"Empty" Then
objTextFile.WriteLine("*Tool"& num &"  * "& N &" *Diameter: "& D &" *Length: "& L &" *Wear Diam"&WD &" *WearLength"&WL & Chr(13) & Chr(10))
Else
End If
Loop
objTextFile.Close
Dim sCOMMAND As String
 sCOMMAND="print c:\mach3\toolinfo.txt"
 Shell("c:\winnt2\system32\cmd.exe /c" & sCOMMAND)
End   

Wow. Other than adding tool wear diam,  wear length, and lpt printing, it's a verbatim lift of a post I made last year.   ::)

http://www.machsupport.com/forum/index.php/topic,4290.20.html
Title: Re: MACRO , Tool Table Report
Post by: vmax549 on August 04, 2009, 09:29:09 PM
KEith and your point is?????  Do you see where I claimed exclusive ownership of the code???  DO you see where it was added to and passed along for others to use??

I suggest IF you do NOT want your code to be reused that you DO NOT POST IT ON A PUBLIC FORUM.

(;-) TP
Title: Re: MACRO , Tool Table Report
Post by: Kenneth on September 04, 2014, 10:21:39 AM
i updated the macro for win7. it doesn't printer to printer but brings up Write.exe
hope this helps someone.

'Macro ToolTable Report
'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:\mach3\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)
WD= Gettoolparam(num,3)
WL= Gettoolparam(num,4)
If N <>"Empty" Then
objTextFile.WriteLine("*Tool"& num &"  * "& N &" *Diameter: "& D &" *Length: "& L &" *Wear Diam"&WD &" *WearLength"&WL & Chr(13) & Chr(10))
Else
End If
Loop
objTextFile.Close
Dim sCOMMAND As String
 sCOMMAND="print c:\mach3\toolinfo.txt"
 Shell("c:\Windows\System32\write.exe /c" & sCOMMAND)
End  


Here is a macro to scan the tool table file and print it out to the local printer. It also write a file copy to the Mach directory called ToolTableReport that can be read from notebook.

You can run it from a button or the MDI

Code Example:

'Macro ToolTable Report
'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:\mach3\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)
WD= Gettoolparam(num,3)
WL= Gettoolparam(num,4)
If N <>"Empty" Then
objTextFile.WriteLine("*Tool"& num &"  * "& N &" *Diameter: "& D &" *Length: "& L &" *Wear Diam"&WD &" *WearLength"&WL & Chr(13) & Chr(10))
Else
End If
Loop
objTextFile.Close
Dim sCOMMAND As String
 sCOMMAND="print c:\mach3\toolinfo.txt"
 Shell("c:\winnt2\system32\cmd.exe /c" & sCOMMAND)
End