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:

piaofcu

Verified Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by piaofcu

  1. Thanks! TpOpList : 'RetrieveIDs' could serve the purpose. ( void RetrieveIDs(IDArray &idArray, bool IncludeSelectedOps, bool IncludeUnselectedOps);)
  2. Not very good at C++,is there anyone give me an example how to get all selected operations? <NetHook> Dim ops = SearchManager.GetOperations(True) For i As Integer = 0 To ops.Length - 1 '...... Next <Chook> auto opSelsCount = TpMainOpMgr.GetMainOpList().CountBySelectFlag(); auto opSels = TpMainOpMgr.GetMainOpList().OpBySelection(true); //point to the 1st operation, how do I get (or loop to) the 2nd, 3rd... selected operations? ??? Thanks!
  3. I found the problem: it seems that it is not possible to edit the tool in debug mode. In Release mode it's fine. TlToolMillPtr tlPtr=......; Cnc::Tool::GetToolSystem()->Edit(tlPtr);
  4. Hello, I am learning C++. I ran into a problem with a dummy function and couldn't solve it. Can someone give me some help? //Get List Of Tools std::vector<Cnc::Tool::TlAssemblyCPtr> toolassemblies = GetListOfTools(); if (!toolassemblies.empty()) { for (const auto toolasm : toolassemblies) { if (MessageBox(get_MainFrame()->GetSafeHwnd(), _T("Open Tool Dialog?"), _T("Tool"), MB_YESNOCANCEL) == IDYES) { //Cnc::Tool::IToolSystem* tl_sys; //error //Cnc::Tool::TlAssemblyPtr spResult; //error //Purpose: Open Edit Tool Dialog. Cnc::Tool::IToolSystem::EditAssemblyTool(???,true); //spResult: Cnc::Tool::TlAssemblyPtr //toolasm: Cnc::Tool::TlAssemblyCPtr } } } vs2019 + 2022. Thanks in advance!
  5. Thanks for the reply! Forgive my poor Chooks knowledge. After looking up, I think ”chain_manager“ doesn't seem to be working for the purpose. Maybe I'm missing something. chain_manager_info ChainManagerInfo; ChainManagerInfo.mode = CHNMGR_GET; ChainManagerInfo.op_idn = opID; chain_manager(&ChainManagerInfo, 0, &succf); "chns" doesn't seem to be useful either?
  6. Newbie questions: When I try to sort the chain?. [CODE] ...... if (op != NULL) { //short n; //n = op->u.prm_cntr.ch_sort.sort_method; //delete if (op->db.ent_count>=3) { op->u.prm_cntr.ch_sort.sort_method =2; // The wrong way? operation_manager(op, OPMGR_REWRITE, &dbPtr, &succf); ...... } } [/Code] ---------------------------------- Nothing happened... Thanks for any suggestions!
  7. As far as I know, starting from 2017, the file extension of all versions is “.mcam”(am i wrong?), so if I use Nethooks to access a certain file, is there a way to get the file version in advance?
  8. Maybe I should look for a way to install the SKD, because I can't view the information when I only have CHM. I want to see what updates are there. "The opcode" ( \interfaces\Core\ToolpathOperationCodes_CH.h)
  9. Windows10 . Maybe it was a problem when I downloaded it... Thank you very much, sir!
  10. When I install "Mastercam2020-sdk-web.exe", I get the following error: Error1606. Coutld not access network location I Google/Bing "Error1606. Coutld not access network location", and follow the found method to try, such as changing the registry, using the administrator... but nothing works. Crazy. (The installation log is included in the attachment.) Anyone have any suggestions? if someone sends a "CHookSDK.chm" to me, thank you very much too! (I only need to check some information,It is not necessary to install sdk) log.txt
  11. May I ask another question? Sir. GroupManager.GetAllGroups Method I can't understand how it works. How is it applied, can it output a list of groups?
  12. When i call the GetOpGroupDataInExternalFile method, it can get “Operation Comment”、“ID ”、“Tool” and “OpCode” (Operation types code? data type : Integer ). In the old version of C-HOOKS, it seems that I have seen header files about opcodes. It should be : TP_CONTOUR 1 //contourI TP_XFORM 4 // mirror, rotate, translate TP_MANUAL_ENTRY 17 //manual entry ... Is this possible if I want to get the toolpath'name(like contour, manual entry...) from OpCode? Or where can i get the information of OpCode (X9) ? I want to try to imitate "Import Toolpath Operations dialog box", It must be used in Toolpath Manager with right-click every time.I want to set the shortcut to enter, but I have not found a way. So I tried to write a NetHook , and support drag and drop mcx-9 files, which will greatly improve efficiency. But at present, this is very difficult: reading the toolpath parameters is one aspect, and it is not difficult to implement drag and drop in Windows Form, but it seems not easy to implement in mastercam. I am very sorry that I am not very proficient programming languages, so this is a big... challenge. Thank you for any suggestions.
  13. This is exactly what I want. And your reply made me learn a lot, thank you very much!
  14. With VBS, I can get OP's number form the specified mcx-9 file. [vbs code] ...... Dim fn,n fn="C:\Test\test.MCX-9" n=GetOperationCount(fn) ...... The focus is: I don't have to open the target file. (Or it opens in the background but does not affect my current file.) Now, with NEThook (X9) , It seems that I need open the file first, then i can get the Number of OP ? I have 2 questions: 1. Is there any way to get information without opening the target file? 2. Or, embed a "vbs file" into the dll ( nethook project ) and then call it directly with the "RunVBScript" Method. Can this be achieved? Thank you for your help.
  15. Roger, Thank you very much for your patience. About the previous question, I found a solution myself. I will come back to ask if there are other problems. Thanks again!
  16. This is really a bad news. By the way,In Visual Studio breakpoint mode, I can see a lot of operation member, As shown “PIC-1" Can I access them? If i access it directly, the error "Not operation member" is displayed. "PIC-2"
  17. Okay, I understand. I try "Operation.GetMinimumZ" Method gets the minimum Z . The document is described as such: Gets the minimum Z coordinate (from the binary NCI) ... No matter whether I save NCI file first or not, I always get the minimum value allowed in a Double. Or "the binary NCI" is not the way to save NCI?
  18. I think maybe I didn't express it clearly. There is a 2D-Contour path: Only select one Chain , Z coordinate is -5.0 (absolute value) . The Contour path setting : depth value is -4.0 , Incremental mode ---> Then the absolute value of the cut depth is -9.0 In VS, get information about this operation: "linking.DepthIncremental" = True, "linking.Depth"="-5." Now, if I want to get the abs value of this operation (-9.0), Is there any way? I thought about calculating the depth of the entity + Incremental depth value,But it seems not easy to achieve.
  19. Thank you for replying, I want to get this parameter in NEThook, but I did not found information about “back plot” in NEThook.
  20. There is another question. If the toolpath is created in incremental mode (contour), then will get "linking.DepthIncremental" - True Is there any way to calculate the ABS value? (incremental to absolute)
  21. Hi, I want to get some operation's parameter. “NETHook” can get many parameter simple, like operation type、tool information... but some parameter i can't find, like cycle time,XY /Z stock to leave. (like "setup sheet report" ) How can i get the operation's cycle time? (X9) Thank you.
  22. Roger, I tried X9 and 20017 (VS 2015) Is OK, but when X6 ( VS2010 ) Get the error. what can i do for X6?
  23. Hello I am new to mastercam API'S too. I Write the code as below, but get an error. code: ---------------------------------------- Imports Mastercam Imports Mastercam.BasicGeometry Imports Mastercam.Database Sub Test() Dim point As New PointGeometry(10.0, 20.0, 0.0) point.Commit() End Sub ---------------------------------------- Error 1 "Commit" has an unsupported return type or an unsupported parameter type. The code "point.Commit()" Can't pass debugging, DId I miss something? Can someone help?

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