Convert CAM Tool Libraries into MASSO Tool file

breezy

Moderator
@breezy Here is the new updated SQL statement, eliminate duplicate fields.
After using the SQLite editor in VSCode I've determined that I only need the following from the Vectric DB.
  • Tool_Cutting_Data
    • Tool_Number
  • Tool_Geometry
    • Diameter
    • Units
    • Name ?? These seem to macros or straight text.
And the following from SprutCam
  • ISTMillToolAccessor
    • Tool_Number
    • D
    • Measurement Units
    • Name
I'm debating whether to use sqlite3.dll or to compile sqlite3.c into my C++ code. Just testing at the moment, getting heaps of errors because the SQLite code is in C with Void pointer and C++ uses exact element pointer so I have been going through the sqlite3.c file adding casts to function calls, etc. which is no mean task considering the file is 261,045 lines. Comment in the file.
** This file is an amalgamation of many separate C source files from SQLite
** version 3.48.0. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit.
I don't want to use the dll as it adds complexity to the end user, so I would like to cut out portions of the sqlite3.c so that only the parts that open, close and read records remains.
 

MaymunBaba

New member
After using the SQLite editor in VSCode I've determined that I only need the following from the Vectric DB.
Well that's what I taught in the beginning, then I found out that Name field macros... If your name field is text, then your logic will be fine.
Not fully understand what your overall goal is, I recommend compiling vs DLL.

I should be done with my code tonight and do at least basic testing tomorrow with my Masso. If all goes expected I should able to post it here tomorrow.
 

breezy

Moderator
I recommend compiling vs DLL.
Compiling is not that easy, C into C++ doesn't go, so I'm going to rewrite in C then hopefully no problems.
Not fully understand what your overall goal is,
To have a single program that can take any CAM tool library and convert it to MASSO tool file.

I started with Fusion as that is what I use, it can output its library as JSON, HSMLIB or CSV. There are several Autodesk CAD/CAM programs available but they all use HSM CAM in one way or another so their tool library output will be the same.

When I get SQLite working it is just a matter of the correct query statement to exact the data.
As SprutCam and Vectric use different extensions on their databases that makes it easy to choose.
Well that's what I taught in the beginning, then I found out that Name field macros... If your name field is text, then your logic will be fine.
Yea, I need to work out how the Name field macros work and if I need to add Tables to convert macros into plain text.
 

breezy

Moderator
When I get SQLite working it is just a matter of the correct query statement to exact the data.
I'm now able to read a SQLite DB using plain old C will need to rewrite the C++ code into C, thinking about how the incoming data was handled I realised it was being double handled, writing it to an array then transferring it to another array that was then written out, where I should have been writing directly into the output array. I'll be able to tidy up the logic with the rewrite.

Reading SprutCam is easy all I need is in one table, but delving into Vectric i have found it is a little more complex because the tool number is in one table that has two entries (only one has tool number, other is NULL) for the one entry in the geometry table and the only link is through a third table.
I really need a Vectric users DB who has a lot of tools in it, my sample is 6 tools with only 4 having tool numbers.
 

MaymunBaba

New member
Here is the link to a zip file:

3 files inside the zip file. One (executable) will read the masso database, one(executable) will convert vectric database to masso database. third (text) one is some additional information related to this work and usage.

I also attached the text file here.

This should eliminate typing Vectric tool database to Masso controller, which can important if you use ATC at hobby level. Commercial shop, will help you update and sync multiple machine from one Vectric database, and ability to refresh across Masso controllers with ease.
 

Attachments

  • VCarvePro version 11.554 Tool Database Information.txt
    3.6 KB · Views: 7

breezy

Moderator
Have added SprutCam to the CAM_MASSO_Convertor program.

This is a total rewrite the program from C++ to C language to accommodate SQLite software needed to process SprutCam and Vectric tool database.

At this stage it is not possible to convert Vectric DBs as I don't have a copy of a Vectric DB for testing from a user who has lots of tools entered.

Edit: New CAM_MASSO_Convertor program is available in post.
 
Last edited:

breezy

Moderator
I can probably supply this once I figure out what I’m looking for.
Look for tool library export.
Export your entire library then zip up a file that has VTDB extension.
I installed Vectric and then removed it after a quick play to create a VTDB file so I could work out it structure.
Using SQLite extension in VSCode was able to get this diagram of the tables in the database.
1737726017551-png.10079
 

safeairone

safeairone
Ok...I think I found it. Went to my Vcarve 11.5 directory and zipped the whole folder labled "ToolDatabase" into this .zip file.

For anyone else looking for their Vectric tool database to post here, the typical path on a windows computer is (of course, look for your particular Vectric product, "VCarve Pro" in my case):

Path.JPG
 

Attachments

  • ToolDatabase.zip
    673.7 KB · Views: 3

Ozymax

Member
"For anyone else looking for their Vectric tool database to post here, the typical path on a windows computer is (of course, look for your particular Vectric product, "VCarve Pro" in my case):"

Path.JPG


Another way to find the file in the Vectric programs is to click on "File" then "Open Application Data Folder".

Untitled.jpg
 

breezy

Moderator
@safeairone
I've transferred your tool data into MS Access, which I understand better than direct SQL and created a query that gives this result.
1738849601018.png
Could you check that tool_type matches the tools, if it is correct then I can start writing code to convert it MASSO tool file.
 

safeairone

safeairone
Now going through all the tables I can't find an entity {Side Angle} but looking at Vectric manual, found this Custom Naming Variables so my question is have you created a custom variable?
Its been a while since I added these tools, but I want to say no, I didn't create a new custom variable. I would have had to create a whole new tool type and I'm just not that thrilled about having to use V Carve Pro in the first place, never mind trying to figure out how to add completely custom tools. I think I just used filled in the information found in the "Tapered Ball Nose" drop down "Tool Type" template list (shown deployed here):

Tool Type Menu.JPG

If it helps you out any, here's the "Name Format" pop-up box. If I right-click on the name format for one of the taper mills, another box opens up showing all the variables that can be used in the tool name (not shown):

Custom Tool Dialog Including Name Variables.JPG

If you need any info regarding my tool table, I'm happy to supply it!

--Mark
 

safeairone

safeairone
Having said that, I guess I DID make a custom tool after all, but it wasn't a taper mill. It was a corner-rounding form tool, found in the "Specialty Profiles" section (which I added) in the tool database directory tree:

Custom Radius Tool.JPG
 

breezy

Moderator
OK you've answered one question
1738883245462.png
I'm trying to find this info in the DB but it looks like that might be hard coded.
Next
1738883420284.png
I can't find that in the DB. :confused:

Guess I'll have to install Vestric and play with the tool table.
 

breezy

Moderator
Some of the naming in play for us is the following for now
#{c.tooltypeShort}-{Tool Number} {Diameter|F}{Units Short} {c.prodName} PN:{c.prodPN}
#{Tool Number} {Tool Type}({Diameter|F}{Units Short}) {c.Flute} {c.Direction}
Where in the DB is {Tool Type} emunation?
This is what I'm talking about
1738910146218.png
To me it seems this is hard coded.
Just that I'm getting conflicting indications from @safeairone DB
1738910508027.png
1738910556731.png
His Diamond Drag bit has tool_type of 9 which from the dropdown is Multi Thread Mill but it correctly displays as DD.
I guess I'll need to create DB with one tool of each type and see what transpires.
 

breezy

Moderator
Latest update on CAM_MASSO_Convertor software, it can now process Vectric VTDB files.
The following is a list name format variables that will be handled by the code.
  • {Tool Type}
  • {Units Short}
  • {Diameter}
  • {Diameter|F}
  • {Included Angle}
  • {Included Angle|0.0}
  • {Side Angle}
  • {Side Angle|0.0}
  • {Tip Radius}
  • {Num Flutes}
  • {Tool Number}
All decimal number will be a max of 4 decimal places.
Any characters that exceed the 29 limit of MASSOs tool file will be discarded.

EDIT: Latest file can be found in this post
 
Last edited:

safeairone

safeairone
In the next few days, I’m going to give the Vectric database converter a try when I upgrade (downgrade?) from the 5.100b beta release to the new 5.09(?) stable release that just came out.

I populate my Vectric VCarve Pro tool database, my Fusion tool database and my Masso tool table by copying the tool data by hand from a Microsoft Xcel spreadsheet, which serves as my MASTER tool data list.

I might have missed it, but is there a way to populate the Masso tool table directly from an Xcel or comma-separated file? For me, this’d be the ultimate way to initially populate the F4 tool table, since the Xcel spreadsheet is my master tool list (and it’s a million times easier/faster to enter tool data into than the F4 screen or any CAM tool database out there.
 
Top