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:

TJ00_SH

Verified Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by TJ00_SH

  1. Roger, Hello. Thanks for sending NetHook & C-hook programs. First of all, tried it on X4 MU3. It worked fine. Used Visual C# 2010 Express for Nethook program, I modified C# program a little, like take only selected operations. Used VS 2008 for C-hook program, no problem as long as I compile for X4 MU3. However, when I changed for X5, some compile error messages shown. Compiling... StdAfx.cpp SetOperationNCI.cpp main.cpp c:\program files\mcamx5\sdk\interfaces\core\TlDefFunctions_CH.h(26) : error C2039: 'shared_ptr' : is not a member of 'std::tr1' c:\program files\mcamx5\sdk\interfaces\core\TlDefFunctions_CH.h(26) : error C2143: syntax error : missing ';' before '<' c:\program files\mcamx5\sdk\interfaces\core\TlDefFunctions_CH.h(26) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\mcamx5\sdk\interfaces\core\TlDefFunctions_CH.h(27) : error C2039: 'shared_ptr' : is not a member of 'std::tr1' c:\program files\mcamx5\sdk\interfaces\core\TlDefFunctions_CH.h(27) : warning C4091: 'typedef ' : ignored on left of 'int' when no variable is declared c:\program files\mcamx5\sdk\interfaces\core\TlDefFunctions_CH.h(27) : error C2143: syntax error : missing ';' before '<' c:\program files\mcamx5\sdk\interfaces\core\TlDefFunctions_CH.h(27) : error C2059: syntax error : '<' c:\program files\mcamx5\sdk\interfaces\core\TlToolMill_CH.h(64) : error C2065: 'tp_tool_ptr' : undeclared identifier c:\program files\mcamx5\sdk\interfaces\core\TlToolLathe_CH.h(59) : error C2065: 'LATHETOOL_PTR' : undeclared identifier Build log was saved at "file://h:\MacamX5_dwnlded\test_C-hook\from_eMastercam_Roger_M\SetOperationNCI (CHook DLL)\Release\BuildLog.htm" SetOperationNCI - 8 error(s), 1 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== If compiled for X4, no error messages. ------ Build started: Project: SetOperationNCI, Configuration: Debug Win32 ------ Compiling... StdAfx.cpp SetOperationNCI.cpp main.cpp Compiling resources... Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 Copyright (C) Microsoft Corporation. All rights reserved. Compiling manifest to resources... Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 Copyright (C) Microsoft Corporation. All rights reserved. Linking... Creating library Debug\SetOperationNCI.lib and object Debug\SetOperationNCI.exp Embedding manifest... Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 Copyright (C) Microsoft Corporation. All rights reserved. Build log was saved at "file://h:\MacamX5_dwnlded\test_C-hook\from_eMastercam_Roger_M\X4_SetOperationNCI (CHook DLL)\Debug\BuildLog.htm" SetOperationNCI - 0 error(s), 0 warning(s) ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== I even tried on different PC, took time to set up, but it's worth. Unfortunately, the same result. Compiled for X5, the same error messages. I took your advice, setting environment variables, SDK_X4 and SDK_X5. Am I still missing something? Thanks for your help.
  2. Roger, Thanks for your prompt reply. OK, looking forward to seeing X5 MU1... Yes, I was VERY interested in Ekke's post. However, we couldn't look at the code you wrote for Ekke, because e-mail was directly sent to Ekke. Is it possible that you can send me the same C-hook program that you wrote for Ekke? I'm sure it will be a big help for me. I double checked my e-mail address registered here, eMastercam, and it is correct. Thanks for your help, appreciated.
  3. Hi. All. I've been looking for a way to change NC file name, (nci name), in each operation. I found some similar questions and code snippets in this forum, and applied the same idea from those. Here is the partial code. foreach (Operation op in selectedOps) switch (op.Type) { case OperationType.Pocket: if (DialogReturn == DialogReturnType.Yes) { DialogManager.OK("No." + cntr1 + Environment.NewLine + " Operation Name: " + op.Name.ToString() + Environment.NewLine + " Operation NCI Name; " + op.NCIName.ToString() + Environment.NewLine + " Pocket:GroupNumber = " + op.GroupNumber.ToString() + Environment.NewLine + " OperationID = " + op.GetOperationID().ToString(), "Operation info"); } op.NCIName = ("C:\\mcamx\\mill\\nci\\" + New_NCI_Name + ".NCI"); OperationsManager.NCCurrentFileNameMode = NCFileNameMode.UseUserDefinedName; OperationsManager.RefreshOperationsManager(); op.Commit(); op.Regenerate(); cntr1++; break; My problem is, once execute op.Commit(), then an operation becomes "dirty", and it needs to regenerate a tool path. I don't want to regenerate a tool path again, just for renaming NC file name. Are there any way to rename NC file name without regenerating a tool path? Before I made this C# program, I found a VB script, "post_selected.vbs", in this forum created by Mr. Roger Peterson on 10/15/04. And I modified the original script, and made it to rename nci name. It worked, but it didn't change Toolpath Group NC file name. Here is the partial code. If contrenaming = 1 Then For counter1 = start_opnum1 To end_opnum1 If GetOperationPostingFromID(vbNullString, counter1) = False Then nci_name1 = GetNciNameFromOperationID(vbNullString, counter1) 'ShowString "op num: " & counter1 & " nci_name1: " & nci_name1 ' rename NCI file name 'Call SetNciNameFromOperationID(counter1, "MM_test111") Call SetNciNameFromOperationID(counter1, sname) nci_name1 = GetNciNameFromOperationID(vbNullString, counter1) 'ShowString "op num: " & counter1 & " nci_name1: " & nci_name1 End If Next End If I tried to do it by C-hook, posted a question few weeks ago, but it will take a long time, because of lack of knowledge and experience. I'm still struggling for learning basics of C-hook... Any advice will be appreciated. If an answer would be for C#, it would be very nice. Thank you, appreciated.
  4. Hi. All. A forever newbie with some programming experience, C/C++ (mostly console mode on old unix machine) and Visual Basic/C# .NET. Tried to learn C-hook several years ago, but didn't make it. Come back once again. I have two questions. (1) C-hook Developer's Guide Are there any updated version of C-hook and NET hook Developer's Guide? The one I'm using, .pdf format, is dated 09/20/06. Asked our Mastercam reseller, but no luck so far. (2) Compiling error Currently, I'm using Mastercam X4 mu3 and corresponding sdk installed. As for programming, using Visual Studio 2008 Standard. Just installed it yesterday. What I'm doing is making a very simple program, the very first one, "Hello from Mastercam!", from aforementioned C-hook Developer's Guide. Error message: .\Chooksample.cpp(103) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR' I think I followed instructions, but I might have done something wrong or simple missed something. Any pieces of advice will be appreciated. Thank you.

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