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:

Jure Klemencic from Camincam

Verified Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Everything posted by Jure Klemencic from Camincam

  1. Alright! With your help I managed to use mill OperationTypes (1 for contour, 2 for drill...) in COperationRef: code: CToolRef tool = new CToolRef(1); COperationRef op = new COperationRef(9,9,1000,1,500,100,100, 10,5,5,0,0,1,true,false,false,true,false,true,false,false,true, false,false,false,true,true,false,true,"OPname","NCIname",tool); This worked fine, but I'm actually interested in creating lathe operations. If I used lathe OperationTypes (51 for face contouring, 52...) the code did not work. It is quite obvious, that the parameters in COperationRef are for mill and not for lathe. Thanks.
  2. I tried to "initialize an operation from scratch" by function COperationRef and it worked, but I couldn't find any table for variable short OperationType. I suppose: 1=Contour, 2=Drill, but where is a complete table? And how can one create for example a lathe operation? Any help will do good
  3. This occurs AFTER the C-Hook asks me to enter two variables into MyDialog and draws a point at a location I show by the mouse. No, I don't run the debug version. I simply compile, link and copy the C-hook DLL into the mcamxCHooks folder. Then I launch Mastercam and click the icon of my C-hook. I know there are two versions of Mastercam.exe, one for Release and the other for Debug, but I didn't manage to run my C-Hook directly from VisualStudio. Thank you for your quick reply.
  4. Great, that was true. After I have added the .lib files my C-hook compiles and links well. BUT when I run the C-hook from Mastercam, it crashes and the attached error message appears. What could be possible reasons? Thanks again!
  5. OK, thank you! You really helped me, because I didn'n know which functions to use nor how to use them. I succesfully used select_ent function in main.cpp: code: MC_BOOL succf; LPCTSTR cs2 = "Select entities"; DB_LIST_ENT_PTR **eptrs = NULL; int *num_eptrs = 0; select_ents (cs2, 0, &succf, PRESEL_CLEAR, &*eptrs, num_eptrs); but then I didn't manage to use the operation_manager function: code: operation op; op.op_idn = 1; DB_LIST_ENT_PTR d_ptr4 = NULL; operation_manager (&op, OPMGR_ADD, &d_ptr4, &succf); Linker complains: quote: main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl operation_manager(struct operation *,short,struct db_list_ent_type * *,char *)" (__imp_?operation_manager@@YAXPAUoperation@@FPAPAUdb_list_ent_type@@PAD@Z) referenced in function _RunMyDialog Please, try to explain, what I'm doing wrong. I don't know what the 3rd parameter in operation_manager ("pointer to operation entity" d_ptr4) is used for. I also don't know if I positioned all the &s and *s correctly. I will appreciate any help!
  6. I would like to get an example of C++ code (C-hook) that makes an operation from existing geometry and then postprocesses it to get the appropriate G-code. Thank you very very much for any answer!
  7. Hi! I would like to ask whether it is possible to develop C-hooks for Mastercam MR1 by MS Visual C++ Version 8.0 (Express Edition)? And is it OK to use .NET Framework Version 2.0? I couldn't compile a project since I don't have windows.h file. And I couldn' make CHook Wizard work. Thank you in advance!
  8. Thank you, but I am afraid code: return MC_UNLOADAPP; doesn't work. Please, I really need help on Create-Letters function. I still couldn't figure out if it is possible to use it with any of C-hook or NET-hook programming languages. The only thing I found is quote: #define TP_LETTERS 23 ///< letters on line 452 of file AssocVar_CH.h. I need to know it to start programming in the appropriate language. But as far as I know by now, C++ is the best and the most powerful choice. Bye!
  9. Thank you! I have done compiling the C++ project from the Wizard and it works fine when I run it from Mastercam.
  10. OK thanks, but it seems like the samples have not been included in the new chm file. Maybe the Chdocs9 would be useful to me. Unfortunately I don't have SDK version 9. I tried www.mastercamextranet.com and www.mastercam.com, but couldn't find it. Therefore, would someone please give me advice, where I could find SDK 9 or upload it to ftp.mastercam.com?
  11. Is it possible to use Create-Letters function in a CHook or in VBS? Recently I wrote my first CHook (that draws a point and displays its pointer). I used C# since I found it easier than C++. Then I wanted to use the Mastercam's function Create-Letters, but didn't succeed. Is it possible to use Create-Letters in C#, C++ or VBS? And some additional questions: After I test my CHook.dll in Mastercam I have to close Mastercam, otherwise I can't rebuild (don't have access to) the CHook.dll file. Then I restart Mastercam and run the CHook.dll again. In order to solve this issue, I put MC_UNLOADAPP in the return line, but it didn't help: code: public override MC_RETURN Run (int param) { ...code... return MC_RETURN.MC_UNLOADAPP; } How to change the code to provide for access to the CHook.dll file? Is it possible to test the rebuilt CHook.dll file directly from Visual Studio? Why are there different Mastercam.exe for debug and release? Thanks!
  12. In this post some document about Chook SDK is mentioned several times ("sample from the Chook SDK on chapter 22 page 19-24"). What document is it and how is it possible to obtain it? Thank you.
  13. I can't run the CHookWizard. I have installed the SDK, done all the steps in dotNet_CHookWizard_Install.doc file, registered CHookWizard.dll file and read all the posts on this forum. But I still don't understand how to use the CHookWizard. All I managed to do is open CHookWizard.dll file in VisualStudio and see its contents. I am very new to programming, please help me. Is CHookWizard to be used only with C++, or also with C#? 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...