Hello Guest it is March 28, 2024, 07:06:07 AM

Author Topic: MACRO , Tool Table Report  (Read 15195 times)

0 Members and 1 Guest are viewing this topic.

vmax549

*
MACRO , Tool Table Report
« 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   

Offline Chip

*
  • *
  •  2,055 2,055
  • Gainesville Florida USA
    • View Profile
Re: MACRO , Tool Table Report
« Reply #1 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
Re: MACRO , Tool Table Report
« Reply #2 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
"If you tell a lie big enough and keep repeating it, people will eventually come to believe it." - Joseph Goebels

vmax549

*
Re: MACRO , Tool Table Report
« Reply #3 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
Re: MACRO , Tool Table Report
« Reply #4 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  
« Last Edit: September 04, 2014, 10:24:56 AM by Kenneth »
Kenneth