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:

yamasaki

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

yamasaki's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I am developing C-Hook application, with Mastercam X3 SDK. And I want to resolve the following problem. I create operation's which associate with each other by parent-child relation. The parent and children expresse one milling. It's like FBM milling. So, if parent is regenerated, then children should be regenarated also. When parent's "regenerate" callback function is called, I want to regenerate all children's nci at the same time. I tried the following code. (It's parent's "regenerate" callback function...) But it does not work fine. code: extern "C" __declspec(dllexport) int regenerate(int) { // listup child operartion's ID. std::vector<long> childIds; { op_list* operationList = 0; ::list_manager(OP_ID, "", LSTMGR_GET, (void**)&operationList); if (operationList) { const op_list* currentOperation = operationList; while (currentOperation) { if (currentOperation->op.db.parent_op_idn == cur_op.op_idn) { childIds.push_back(currentOperation->op.op_idn); } currentOperation = currentOperation->next_ptr; } } ::list_manager(OP_ID, "", LSTMGR_FREE, (void**)&operationList); } // I want to regenerate child operation's nci by following code. // but it does not work fine. nci_manager() return false. for (size_t i = 0; i < childIds.size(); ++i) { nci_bin nci; ::ZeroMemory(&nci, sizeof(nci)); long position; MC_BOOL successFlag; ::nci_manager(childIds, NCIMGR_REGEN_ONE, &nci, &position, &successFlag); if (!successFlag) { throw MC_ERROR; } } return MC_NOERROR; } Thank you in advance. And sorry for my poor English.
  2. I want to control the operation manager (tree view). Specifically, I want to make the following tree structure like "FBM mill" operation. code: +Machine Group-1 (default) +Toolpath Group 1 (default) +My top operation group (*) +My top operation (*) +My sub operation group (*) +My sub operation (*) +My sub operation (*) +My sub operation (*) +... (*) is the nodes appended from my C-Hook module. So, I want to know the method of the following steps. - create new operation group. (step1) - append the operation to the operation group. (step2) I can do step1 with list_grp_add_empty(). My question is about step2. I think that I should use list_grp_append_ents(). I tried the the following code, but it didn't move as thought. code: DB_LIST_ENT_PTR entity; MC_BOOL success; ::operation_manager(operation, OPMGR_GET, &entity, &success); if (!successFlag) { ...error handling... } ::list_grp_append_ents(group_id, 1, &entity, &success); if (!successFlag) { ...error handling... } The success flag retruned "TRUE" from the both functions. But, it seemed not to be reflected in the tree view. Any help will be appreciated. Thank you.
  3. Thank you Roger, After I sent mail to you this morning(in Japan), I made further investigation by myself. As a result, it turned out that constructor of ChangeResCl failed in Debug module. And Release module worked fine. Is it the specification of Mastercam? Or, my usage is wrong? If you have any information about it, please tell me.
  4. I'm making a C-Hook module with VisualStudio2005(C++) & MastercamX3. But, I have a trouble in showing dialog with MFC. Here is the step of my problem. 1. To showing dialog, I wrote code like this... #include "TestDlg.h" extern "C" __declspec(dllexport) int m_main(int) { CTestDlg dialog; dialog.DoModal(); } 2. But Debug Assertion occurred at dialog.DoModal(). 3. I think it's resource error of DLL. So, I append this code in front of declare of dialog. #include "TestDlg.h" extern "C" __declspec(dllexport) int m_main(int) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); // append code CTestDlg dlg; dlg.DoModal(); } 4. But this time, the linker error occurred, because of "DllMain() is doubly defined". *I made C-Hook module with CHookWizard and it is set to extended DLL. mfcs80d.lib(dllmodul.obj) : error LNK2005: _DllMain@12... 5. So I removed DllMain(). But the runtime error occurred at start of Mastercam, after all. Could anyone help me? And sorry for my poor English.

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