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:

sigmawave

Verified Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by sigmawave

  1. Hi, every one. I have a subject to get the tool information from each operation. I found some issues with this topic. For some tools, they are both Milling tool and Lathe tool in Mastercam, such as "Center Drill". Let's take it as an example. If the center drill is used in a Milling operation, I can't get the drill diameter (not the body diameter) data from the tool. But if there is a center drill used in a lathe operation. I can get the same parameter from the ltool varaible. There are some other tools with the same problem. like: reamer, face mill. etc. Does anybody meet the same problem as me? If you know the solution, please tell me. Thanks a lot!
  2. I downloaded the Nethook_2.0 Examples. It is very good, very easy to use. I wrote some Nethook test program. I got some questions for that. The following is a typical one. Purpose: I want to retrieve all the Centerdrill properties (including the hoder) from Mastercam. I declare a variable of Centerdrill class. like following: code: Dim aCenterdrill as Mastercam.Tools.CenterdrillTool = new Mastercam.Tools.CenterdrillTool() Try to look all the properties of the variable "aCenterdrill". It has the properties inherited from Class "Tool" only. They are: CornerRadius; Diameter; DiameterOffset FluteLength; Length; LengthOffset; Name; Number; ShoulderLength; How can I get the properties special for Centerdrill, such as "Shoulder angle" and "Tip angle". All the other tools are the same thing. I checked the C-Hook help document. I can get relative infomation about the "Tip angle" etc. I am a freshman on NetHook development. Maybe I am taking the wrong way to retrieve the tool properties. I hope somebody can answer me about that. Thanks in advance.
  3. I just want to translate the NCI file to GM code by myself. Certainly they come with the machine and control definitions.
  4. Colin, I tried that method. Problem still there. I think I found the reason. It is because of the Mastercam version difference. My Mastercam is X2 MR2, but my workmate's is X2. I tried an inverse method. I created the machine, control, PST file in lower version Mastercam. Then imported all the files into my Mastercam, it works. So, I believe it is the compatible problem. By the way, this issue can happen only in the post processor with the third part post-executable file. If I change the post-executable file in my control file to MP.DLL, no problem at all. Whatever, thanks again! I am very happy with all of you guys.
  5. I just finished my post executable dll for replacing the MP.dll. It works fine. But I got another issue when I distribut the Post. I created all the files by myself in Mastercam. 1. a new mill machine file like "a.MMD"; 2. a control file like "b.control"; 3. a Post processor file- "c.PST"; I save the first two files in "cnc_machines" folder, and the last one in "millposts" folder. Certainly the post executable file "d.dll" is in folder-"apps". When I create the control file, I linked the "post executable" file to my own dll, selected the "PST" file created by myself as the post processor. The machine model uses the control file mentioned above. After selecting this machine in my case on my computer, all of them runs perfect. Clicking G1,the NC code will be generated automatically based on my own post-processor. I copied the machine file (a.MMD), control file (b.control), the post-processor file (c.PST) and the post executable file (d.dll) to my workmate's computer. Certainly I put each file in its corresponding folder in Mastercam installation folder. When I open the Machine file in the "Machine Definition Manager". I found no .PST file with the control file. Anybody can tell me what is this problem? Thanks a lot!
  6. 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.
  7. 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!
  8. Yes I am. I am trying to develop a Post processor by myself, and encapsulate it in a DLL. When I am working with it, I do find some problems in the NCI file format. Maybe it is because I don't know this subject very well. Anyway, thank you for your advice, Colin!
  9. I am wondering how to set the precision for some values, for example: code: 1050 11 36 30 5 2008 10 20 0 D:MCAMXMCXLINECONTOUR.MCX 999 1 0 1 1051 Generic Mill 1053 Machine Group-1 1011 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1012 2 0 0 0 0 0 0 0 0 0 1013 0 5. 0. 1 1 0. 0. 0. 2 D:MCAMXMILLTOOLSFLATMILL.mcx 1014 1. 0. 0. 0. 1. 0. 0. 0. 1. 1016 1 10 1 1 0. 0. 0. 41 0 1 4 0 0. -1 0 2 1 1017 1. 0. 0. 0. 1. 0. 0. 0. 1. 950 0 0 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1025 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1027 1. 0. 0. 0. 1. 0. 0. 0. 1. 0. 0. 0. 1028 0 0 0. 0. 1. 0. 0. 1. 0 0 0 0 1029 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 0 1020 35.355339 35.355339 0. 17.67767 17.67767 0. 0 0. 0. 0. 0. 0 50000 ALUMINUM mm - 2024 20010 TOP 20011 20012 TOP 20013 20014 TOP 20015 20016 ALUMINUM mm - 2024 20017 20018 Toolpath Group-1 20019 20001 5. FLAT ENDMILL 20002 20003 20004 214 10 1 0 5. 0. 0. 180. 214 214 1.790625 1.790625 1.790625 0 16 4 20006 0 50. 50. 25. 25. 0. 0. 0. 20007 0. 50. 75. 60. 5. 50. 25. 0 25. 25. 1 20008 0. 0. 1. 0 0. 0. 0 0. 0. 1001 0 100 2 214 214 214 0 0 1.790625 0 -1.76776695 1.76776695 50. 250. 250. 250. 0 0. 0 0 -1.76776695 1.76776695 50. -2. 0 0 0 -1.76776695 1.76776695 10. -2. 0 1 0 -1.76776695 1.76776695 -5. 1.790625 0 1 0 7.24964853 10.78518244 -5. -1. 3000 2 0 0 13.54217727 11.42085693 10.78518244 7.24964853 -5. -1. 0 0 3 0 0 25.17766953 17.67766953 17.67766953 17.67766953 -5. -1. 0 0 3 0 0 23.93448212 21.81316178 17.67766953 17.67766953 -5. -1. 0 0 2 0 0 24.57015661 28.10569052 28.10569052 24.57015661 -5. -1. 0 0 1 0 33.58757211 37.12310601 -5. -1. 300 1 0 33.58757211 37.12310601 5. -1. 0 0 0 33.58757211 37.12310601 50. -2. 0 1011 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1012 2 0 0 0 0 0 0 0 0 0 1013 0 5. 0. 1 1 0. 0. 0. 2 D:MCAMXMILLTOOLSFLATMILL.mcx 1014 1. 0. 0. 0. 1. 0. 0. 0. 1. 1016 1 10 1 1 0. 0. 0. 41 0 1 4 0 0. -1 0 2 1 1017 1. 0. 0. 0. 1. 0. 0. 0. 1. 950 0 0 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1025 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1027 1. 0. 0. 0. 1. 0. 0. 0. 1. 0. 0. 0. 1028 0 0 0. 0. 1. 0. 0. 1. 0 0 0 0 1029 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 0 1020 35.355339 35.355339 0. 17.67767 17.67767 0. 0 0. 0. 0. 0. 0 50000 ALUMINUM mm - 2024 20010 TOP 20011 20012 TOP 20013 20014 TOP 20015 20016 ALUMINUM mm - 2024 20017 20018 Toolpath Group-1 20019 1000 0 100 2 214 214 214 0 0 1.790625 0 -1.76776695 1.76776695 50. 250. 250. 250. 0 0. 0 0 -1.76776695 1.76776695 50. -2. 0 0 0 -1.76776695 1.76776695 10. -2. 0 1 0 -1.76776695 1.76776695 -5. 1.790625 0 1 0 7.24964853 10.78518244 -5. -1. 3000 2 0 0 13.54217727 11.42085693 10.78518244 7.24964853 -5. -1. 0 0 3 0 0 25.17766953 17.67766953 17.67766953 17.67766953 -5. -1. 0 0 3 0 0 23.93448212 21.81316178 17.67766953 17.67766953 -5. -1. 0 0 2 0 0 24.57015661 28.10569052 28.10569052 24.57015661 -5. -1. 0 0 1 0 33.64968513 37.18521904 -5. -1. 0 1 0 1166.20421388 1020.84357961 -5. -1. 300 1 0 1166.20421388 1020.84357961 5. -1. 0 0 0 1166.20421388 1020.84357961 50. -2. 0 1003 250. 250. 250. It is a very simple NCI file. We can see there are various precision settings in various places. code: 1020 35.355339 35.355339 0. 17.67767 17.67767 0. 0 0. Commnad 1020 has 6-digitals after decimal setting. code: 0 0 -1.76776695 1.76776695 10. -2. 0 1 0 -1.76776695 1.76776695 -5. 1.790625 0 1 0 7.24964853 10.78518244 -5. -1. 3000 2 0 0 13.54217727 11.42085693 10.78518244 For movement commands, they have 8-digitals setting. How can I change them? Are they predefined internally in Mastercam? Thanks!
  10. Thank you for your reply. Sorry if I didn't explain the problem more clearly. Firstly, I just want to create a CHook DLL to analyze NCI and generate NC code. In V9 we have some numbered question type definitions in the PST file we can use to tell MP to use a different DLL for posting. I use this question: code: 91. Name of executable CHook? But now, this numbered question functions are not supported from Mastercam X. In another word, I am looking for the alternative methods in X2 to do the same job with the numbered questions in the earlier post.
  11. Are you talking about V9 rather than X2? What will we do in X2? Thanks
  12. I have a dll. It is for analysing the NCI file. I just want to call the dll after generating the NCI file. I found a clue in another thread, there are some codes as follow: stringDLL "c:mcamx2-mr2chooksmyCHook.dll" # user string var in PSTstringPARAMS ' "first" "second" "third" ' # user string var in PSTppost$ # A postblock real_result = dll(stringDLL, stringPARAMS) I created a PST file contains that codes. But it doesn't work. Anybody can give me a example for this. Thanks!

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