Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Reading .TOOLDB in mastercam x6 using chooks


Recommended Posts

Hello,

I am using mastercam x6 chooks SDK  to build a plugin.

I need to read the tool information stored in the file with extension .TOOLDB. Can someone please let me know how to read the tool information from this file.

I tried using "read_ent(file_ptr,&tl_ent,&ok);" but it fails.

I have been able to read tool information from TOOLS-6 files from the above function call.

Link to comment
Share on other sites

Since the file is a database file .. though you cannot use Mastercam  chook calls to work with the database you should be able to write your own code using a SQLite database driver to read data from the database.

 

There is a data browser on their web page that should allow you to see the SQL structure of the relational database.. assuming you know SQL you could then create queries to pull whatever data you wanted ..

Link to comment
Share on other sites

While not C-Hook related I was able to whip up a C# NET-Hook example that connects to the router_inch.tooldb and gets all the information in the TlToolMill table. This might be of help to you.

 

The NET-Hook project is using the SQLite providers that you can pull in from the nuget package manager (see image)

 

There are a number of open source SQLite database programs out there that you can use to open a tooldb and see what tables are in there etc, be wary of making changes unless you know what you are doing.

 

The project is rather big with the packaged assemblies so if you want it and have a place for me to upload it send me an email or PM me.

post-4901-0-01914700-1439997016_thumb.png

post-4901-0-24105000-1439997019_thumb.png

post-4901-0-88928000-1439997019_thumb.png

post-4901-0-76457200-1439997020_thumb.png

post-4901-0-88401500-1439997896_thumb.png

Edited by Mick from CNC Software Inc.
  • Like 1
Link to comment
Share on other sites
  • 1 month later...

Mick, 

        You mentioned to be wary of making changes unless you know what you are doing...does that mean it is possible to read and write to a tooldb file? I would like to be able to connect to and update a tooldb file,  rename it, then retrieve the new file in Mastercam. I would not use any of the Mastercam supplied tooldb files, I would create one, save it, and constantly reuse it. My current application connects to an external database and works in disconnected mode allowing the user to find the desired tool, then I had hoped to update a tooldb file with the values from the external database. I originally was updating the exported text file (now outdated). If it can be done, I would like to obtain the NET-HOOK project you mentioned.

 

Thanks, JCDFCM

Link to comment
Share on other sites
  • 1 month later...

JCDFCM,

 

Apologies for not replying sooner, I completely missed this.

 

I would just make sure to back up any tooldb files you intend to read/write directly, just to be safe.

 

Mick, 

        You mentioned to be wary of making changes unless you know what you are doing...does that mean it is possible to read and write to a tooldb file? I would like to be able to connect to and update a tooldb file,  rename it, then retrieve the new file in Mastercam. I would not use any of the Mastercam supplied tooldb files, I would create one, save it, and constantly reuse it. My current application connects to an external database and works in disconnected mode allowing the user to find the desired tool, then I had hoped to update a tooldb file with the values from the external database. I originally was updating the exported text file (now outdated). If it can be done, I would like to obtain the NET-HOOK project you mentioned.

 

Thanks, JCDFCM

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...