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:

How to retrieve the NCI and NC file pathname?


Recommended Posts

I am trying to develop the dll to replace the MP.dll.

Before I call my own dll, I should get the NCI file and NC file paths and names. So they can be transfered to my dll as parameters.

 

The following is my codes:

 

 

code:

 

extern "C" __declspec(dllexport) int PostMain(int prm)

{

CString ncifile;

LPTSTR nciPath, nciName, nciExt;

long op_idn;

CString tStr;

ncifile = NCIFileStr(op_idn, nciPath, nciName, nciExt);

tStr.Format("%s%d", "op_idn: ", op_idn);

AfxMessageBox(tStr);

tStr.Format("%s%s", "nciPath: ", nciPath);

AfxMessageBox(tStr);

tStr.Format("%s%s", "nciName: ", nciName);

AfxMessageBox(tStr);

return m_main(prm);

}


Note: The above code is only for this issue, it's a section of my CHook, NOT the entire code.

 

Certainly, I included the "machinedeffilesandpaths_ch.h" and changed the "Post executable" from MP.dll to my compiled dll.

After I clicked "G1", selected the ouput NCI file and NC file. the message dialogs poped up.

 

But I can't get the NCI and NC information.

 

Please help me to fix this issue.

 

By the way, anybody can tell me where can I find some CHOOK developing documentations. I have the Mastercam V9 MP Post Reference Guide. But there is a big difference between V9 and X development.

I can not follow the previous way to develop programs with X and X2.

With the Mastercam X2 sdk, there is a help file named "CHookSDK.chm" . It is only a function and variable list without any example demos.

Where can I find some demo codes?

 

Thank in advance!

Link to comment
Share on other sites

I think you need these...

code:

  

AfxMessageBox(op.cmn.nci_name);

AfxMessageBox(post_args[2]);

Still you don't have the nci output as a text file.

You have to use the postOps funtion or the nci_manager function..

 

 

quote:

By the way, anybody...

I have the Mastercam V9 SDK document only, it has some demo codes..

but the X sdk header files are well commented, so it is good to code a chook.

 

 

X3?

Mastercam X3 API - Whats New.doc

quote:

The Mastercam APIs are undergoing drastic changes for the Mastercam X3 release later this year.

biggrin.gif

Link to comment
Share on other sites

It is the first time to develop C Hook with Mastercam. I am trying to get the general rule of the CHook programming. If I have any question I can not get the answer easily.

 

It doesn't like CATIA. Even CATIA automation help document is not well maintained. I can search on the web to get helpful information easily.

 

I am not complaining, I just feel it is difficult to start with Mastercam programming.

 

Whatever, Thanks a lot for your information. I will try that.

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