Sign in to follow this  
keta

exchange tool with mastercam

Recommended Posts

Can you give us a overview of using C-Hook SDK or a example for transfer tool data like

Tooltype, Diameter, ZLength, ... to MasterCAM.

 

Is it possible to transfer additional tool technology data ?

 

thanks.

Share this post


Link to post
Share on other sites

keta,

 

Can you supply more details?

 

Are you wishing to "load" an operation with Tool data? or...?

 

"additional tool technology data"...?

A 'tool' definition contains a fixed number of data fields. There are a couple that you can use for whatever purpose you wish.

Share this post


Link to post
Share on other sites

roger,

 

we are planning to develop an interface between MasterCAM and our TDM Tool Database System.

 

To go on we need more informations about possibilities of tool data exchange from our tool database into MasterCAM. How is it possible to put a tool from outside into MasterCAM ?

 

thanks

Share this post


Link to post
Share on other sites

On the Mastercam side: The tool_manager function can add a tool to the current session of mastercam. list_manager function can read the tool in the current session of Mastercam, tool library, or other Mastercam file.

 

You would just need to add the proper values in the tp_tool stucture and call tool_manager to add the tool.

 

Bryan smile.gif

Share this post


Link to post
Share on other sites

yes, thanks a lot, very helpfull.

 

I found these function declaration in AssocHok_CH.h file (see below).

DllImpExp void tool_manager (

tp_tool *tl,

short mode,

DB_LIST_ENT_PTR *eptr,

MC_BOOL *succf);

 

Is there a documentation about these function

or an example.

 

Sorry, I'm very new in CHooks programming.

 

Is it possible to make a new MFC Dialog with a

search list of tools in a CHook application ?

 

After the user choose a tool, I just put the tool values in the tp_tool structure an call tool_manager. Is that all, was I have to do ?

Share this post


Link to post
Share on other sites

Keta,

 

To assist, I need to narrow down what you want to do…

 

1> You want to load a tool with data from an “external” source and add the tool to the *active* Toolpath Group’s tool list.

-or-

2> You want to import tool data from and “external” source and create a TOOL library that contains the data.

Share this post


Link to post
Share on other sites

Roger Martin,

 

The first one, Position 1 is what I will do.

 

thanks

Share this post


Link to post
Share on other sites

yes, all right.

Thanks a lot for your help.

 

In your example, you use a lot of function

like OMgetActiveMachineGroup(), PromptForToolFile()...

 

Where can I get a description about these

functions ?

 

Is the tool after tool_manager() call ready for

operations in MC ?

 

thanks.

Share this post


Link to post
Share on other sites

OMgetActiveMachineGroup() - is declared in CGui-ch.h

It simply returns a group_list* pointer. (You'll find the definition for group_list in groups_ch.h) Do note the default on the optional parameter = TRUE to create an active machine group, if there isn't one.

 

PromptForToolFile()?

I assume you are referring to the PromptForFileToOpen() function - you don't really need this.

You can easily replicate what it does using std. File Open functions.

 

"Is the tool after tool_manager() call ready for

operations in MC ?"

 

Yes...

It is just as if you had loaded it in the 'part' tool list using the std. 'Select Library Tool...' button on the Toolpath Parameters dialog.

Share this post


Link to post
Share on other sites

thanks for your last message.

 

Now a other question:

Is it possible to use NET-Hook also for import

tool data like C-Hook function

tool_manager(&tl, TLMGR_ADD, &eptr, &succf)

Share this post


Link to post
Share on other sites

Keta,

 

You can absolutely import tool data through the NetHook API, although you won't get the same level of customization and detail that you would through the CHook API, however, and it works very differently.

 

I'll assume you already know how to set up and get a NetHook app running (if you don't, no worries - I've included some links that should be able to help you get started below), so I'll just cut straight to working with tool objects in the NetHook API. Everything in the API is represented by objects, and tools are no exception. Say you wanted to import a new Drill? You'd probably want to do something like this (C# pseudo-code):

 

code:

{

...

 

if (!MachineDefManager.IsCurrentMachineGroupMill())

MachineDefManager.CreateMillMachineGroup();

 

DrillTool MyTool = new DrillTool();

 

MyTool.Diameter = 1.0;

MyTool.CornerRadius = 1.5;

MyTool.Name = "My 1-inch Drill Tool";

 

...

 

MyTool.Commit();

 

...

}


It's as simple as creating a new tool object, filling in the parameters, and calling the 'Commit()' method on it to submit it to the database. It should be noted however, like I said above, you won't get the same level of detail. The editable parameters in a NetHook tool object include:

 

Diameter

Corner Radius

Number

Length Offset

Diameter Offset

Length

Flute Length

Shoulder Length

Name

 

 

If you need to be able to edit and import more data than that, then the NetHook API won't be able to support your needs just yet. In case you need any more additional help, or you want some tips / pointers on how to start your own NetHook app, check out the NetHook Samples & Examples project up on the main Mastercam site:

http://www.mastercam.com/Support/Downloads....0_Examples.zip

 

Hopefully that's enough to get you started and answer your questions - if you have any more questions, feel free to post them.

Share this post


Link to post
Share on other sites

thanks a lot,

 

Does NetHook API also support lathe tools ?

How is it possible to set feed and speeds to

a tool if I want import a new tool object ?

Share this post


Link to post
Share on other sites

Hi again Keta,

 

quote:

Does NetHook API also support lathe tools?

Not in the current version of the API. It's on the list of things that would be nice to add in the future, though, and we're hoping down the road this is something we might be able to add.

 

quote:

How is it possible to set feed and speeds to a tool if I want import a new tool object?

Surprisingly enough, it isn't possible as of right now - although it should be. This is something that must have slipped under the radar for the first 2.0 version of the API. It'd be a useful addition, though, so I put it on the list of things to add. Look for feeds and speeds parameters in the tools base class in a future version.

 

Hope that answers your questions, and thanks for the feedback.

Share this post


Link to post
Share on other sites

Hi,

along time ago at january you give me a chook example to add a new tool with tool_manager() see below.

 

tool_manager(&tl, TLMGR_ADD, &eptr, &succf);

 

Now I would like to add also lathe tools, I can do that with function ltool_manager(). But I do not know how to setup the LATHETOOL structure. Is there a example for that also for custom tools (tl.fCustom=TRUE) like TAPS, DRILLS ...

Share this post


Link to post
Share on other sites

keta,

 

A lathe tool is just a (data) sub-structure of an ent, similar to 'tp_tool' that is used for Mill.

 

Member of ent ->

LATHETOOL ltool; ///< lathe tool

 

It's details are defined here ->

ltooldef_ch.h - LATHE TOOL DEFINITION...

 

Of course there is a different Tool Manager for lathe tools. (It is declared in AssocHok_CH.h just below the Mill tool_manager) ->

 

DllImpExp void ltool_manager (

LATHETOOL *tl,

short mode,

DB_LIST_ENT_PTR *eptr,

MC_BOOL *succf);

Share this post


Link to post
Share on other sites

thanks.

 

Is it normal to set all tool values like diam, radius, length... into structure LATHETOOL as inches unit ?

Share this post


Link to post
Share on other sites

thanks, other question:

 

For turning tool we use custom types (tl.fCustom=TRUE). Now we do not know the fields they are necessary (mandatory) to filled out in these mode (structure INSERT, LDRILLTOOL, GRVINSERT, THDINSERT, GTBINSERT).

Share this post


Link to post
Share on other sites

Is it possible to set-up Mastercam to use holders,tools,inserts,etc. from a external source altogether? I would like to keep the library I have set-up in Vericut as a "master" and have Mastercam pull from that. Vericut uses an XML format. This seems so much easier to me than altering custom drawn tools all the time. In my dreamland, I could somehow use the graphical interface of Mastercam to set my tool exposure length, but use my other settings from the Vericut library.

Share this post


Link to post
Share on other sites

@all,

 

i have nearly the same problem as keta.I wish to import a csv-file with tool-data into a tool-library. but this seems to be a hard thing.

i tried some functions like tool_manager(...), but mastercam crashes with a runtime error. I'm not sure how to use the toolmanager-modes like TLMGR_EDIT, TLMGR_ADD ...

 

@Roger Martin, is it possible to get the code-snippets which you sent to keta?

 

My code looks like

code:

tp_tool tool;

DB_LIST_ENT_PTR d_ptr;

MC_BOOL *succf = FALSE;

 

tool.op.slot=0;

tool_manager(&tool,TLMGR_MENU,&d_ptr,succf);

Thanks in advance

Share this post


Link to post
Share on other sites

I need to ask the same questions I asked Keta -

 

To assist, I need to narrow down exactly what you want to do...

 

1> You want to load a tool with data from an “external” source and add the tool to the *active* Toolpath Group’s tool list.

-or-

2> You want to import tool data from an “external” source and create a TOOL library that contains that data.

 

These 2 things may sound similar, but the way to accomplish each is quite different...

 

With #1 you use the Tool_Manager.

If doing #2 - creating a Tool Library (a .TOOLS file), you do not use the Tool_Manager functions.

 

Keta wanted to do #1.

By this statement -> "I wish to import a csv-file with tool-data into a tool-library."

It sounds like you are looking to do #2.

Share this post


Link to post
Share on other sites

Roger, that's right. #2 is the way i prefer.

But it might also be interesting, to understand the way #1, for example if i create an empty dummy library with mastercam, and than filling it with the "Tool_Manager".

 

Thank in advance,

Norbert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 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