Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: ozwes007 on May 18, 2015, 08:37:14 AM
-
If you want a tool table to import this may help. It has a generic listing I made of Drills and Mills upto an Inch and 20MM with both metric and Imperial dimensions of each.
Just cut and shut in Excel to get what you need then make a macro to import them into Mach3 tool Table.
And no i haven't made a macro as yet :-[ I believe there may be one somewhere. If any one finds it post it here and we can all use it.
Feel free to add to the list if you want.
These are the various formats to extract the data so the reverse will get it in. These are simply info I have collected from this Forum. So kudos to the guys who put them up.
G Code Example :
G10 L1 P~ X~ Z~ (Description)
P = Tool Number
X = Diameter
Z = Offset
Macro 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:\windows\system32\cmd.exe /c" & sCOMMAND)
End
VB Example
Option Explicit
Dim Response As Integer
Dim Path As String
Dim ToolNumber As Integer
Dim ToolDiameter As Double
Dim ToolLength As Double
Dim ToolDescription As String
Dim i As Integer
'Note the GetMainFolder is incorrect I beleive
Path = GetMainFolder & "myTools.txt"
Open Path For Output As #1
Print #1, "Mach3 Tooltable printout" & Date() & " " & Time(Now)
Print #1, ""
Print #1, "Tool:" & Chr(9) & "Diam:" & Chr(9) & "Length:" & Chr(9) &
"Description:"
For ToolNumber = 1 To 250
ToolDiameter = GetToolParam(ToolNumber, 1)
ToolLength = GetToolParam(ToolNumber, 2)
ToolDescription = GetToolDesc(ToolNumber)
Print #1, ToolNumber & Chr(9) & ToolDiameter & Chr(9) & ToolLength & Chr(9)
& ToolDescription
Next
Response = MsgBox("Your file is at the following location: " & Path, 0)
Close #1
Wes
-
Ok ,for those that are interested I have made a Macro to pull a tool table in.
The ToolsXTG.csv file resides in your C:\Mach3 folder
and you can run the macro (importTools.m1s) from the VB Editor from inside Mach3
Small note: don't put any more then 253 Entries in the CSV or it will not put them in. Tool Table limitation.
The tools.csv has a different setup then the ToolsXTG as it has Inch and Metric dimensions of the same tools.
If you use Inch use the tools.csv and make it look the same as the ToolsXTG,csv file.
If you wish to add tools into the tools.csv file and upload it here then go for it.
This is a community forum and the more tools in the file the better.
Also i Have included the Export tool table macro as well(MToolTableReport.m1s)
There are 2 other dimensions I haven't used, Wear dimensions, but if you uncomment them in the macro you should be right to go.
Wes
-
Good JOB on the functions BUT it has already been done before(;-)
(;-) TP
-
Thanks TP, if there is another tool.csv file( or similar) with tools already populated in it we should be able to grab the two and meld them into one big CSV. Could you point us in the right direction and we can start work on it. I've had a quick look but can't seem to find it, sorry. Maybe we can modify the import Macro to suit the Versions of Mach Tool Tables. I beleive earlier versions had a different number of tools.
Wes
-
I meant that the Macros for tool export and import have been done before. Mach3's tool table has been the same for as long as I can remember.
The importing will depend on HOW the tool table file that is being used is structured.
(;-) TP
-
Ok TP, I knew the export was done before, I think the top ones are Art's from memory. Haven't seen any import ones, however if there better ones around we should place them into a common folder.
Wes