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:

exchange tool with mastercam


Recommended Posts

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

Link to comment
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

Link to comment
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 ?

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites
  • 4 weeks later...

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.

Link to comment
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.

Link to comment
Share on other sites
  • 7 months later...

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 ...

Link to comment
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);

Link to comment
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.

Link to comment
Share on other sites
  • 4 weeks later...
  • 2 months later...

@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

Link to comment
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.

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...