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:

Errors on Open (NetHook, C#)


Recommended Posts

Hello,

I'm attempting to read a list of tools out of a bunch of mastercam files using Nethook/C#

The base structure is this (which works as expected):

string filepath = "C:\\TEST\\TEST.mcam";

FileManager.Open(false, filepath);

Tool[] mcamToolList = SearchManager.GetTools();

Unfortunately, some of the files have errors/warnings when opening, and mcam presents a dialog saying "There were one or more errors...".

I can manually click "OK" and continue on, but with multiple files, I would prefer to avoid manual interaction.

Is it possible to suppress these error messages?

 

Otherwise, on a related note - Is there an alternative to FileManager.Open()?

I would like to "activate" the database so SearchManager can interact with it - is there a way to "get" a database without using FileManager.Open?

(i.e - I would like to read the file contents into a DB object without actually Opening the file)

 

Thanks!

Link to comment
Share on other sites
1 hour ago, Jbrunelle said:

Unfortunately, some of the files have errors/warnings when opening, and mcam presents a dialog saying "There were one or more errors...".

I can manually click "OK" and continue on, but with multiple files, I would prefer to avoid manual interaction.

Is it possible to suppress these error messages?

You can hook the windows messagebox with a messagehook and send the wm_close method to the dialog, it's rather complicated, I have yet to translate the class to csharp...

I can provide more info if you want to go that road..

 

Mick mentioned the toolnetapi, here is a similar topic you can read through to get an idea..

 

Link to comment
Share on other sites

Thanks for the response. I hadn't seen any examples labelled as "ToolNetApi" so far, but i'm looking into a few now.

The few I've seen so far look like they're specifically targeting the *.DB files. 

Since I'm trying to get a list of tools used on a given job (within a specific .mcam file), I'm not sure how this api helps / I can't find anything to help.

I essentially already have the info I need and my program is working properly (mostly):

list.png.e15fae0067d0b7e3b0e79bbd395d6316.png

This is effectively all the info I need from a given file. The problem is this error message (and others like it) that requires manual input:

mcam.png.a35cc54cfd6148b8c20ed3bb363140eb.png

Is there any way to bypass this error/warning message? Or even temporarily disable warnings from within Mastercam or something?

Otherwise, if there is something within ToolNet that i'm missing, so more guidance as to where to look would be appreciated.

Thanks!

Link to comment
Share on other sites
9 minutes ago, byte said:

You can hook the windows messagebox with a messagehook and send the wm_close method to the dialog, it's rather complicated, I have yet to translate the class to csharp...

I can provide more info if you want to go that road..

This seems like something that may work for me, I'll look into it a bit on my end.

Also... Thanks for the link to that other thread! Reading through that should keep me busy for a while. :)

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