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. The picture shows the turning operation are using two different WCS.
  2. Thank you for your reply. Crazy^Millman. I just want to ask a simple question. If I want to run the two spindles at same time. If all the operations are turning ones, I can use the "Coordinate" to setup the toolplan origins. So I can get the program origin-54 for Left spindle, G55 for right spindle. It means I can use the tool plane to get what I want. In case of the milling operation are involved, I may use different tool planes for different milling operations. For example, I prefer to use the top face of the slant surface when I do a face milling (3-axis milling) on it. In such situation, I would like to make all operation on one side to have a common WCS. I can calculate the tool positions and vectors on one spindle (both milling and turning) to make them to be relative to the common WCS in post. I hope I explained clearly. Thanks again!
  3. Hello, everybody I have a question about changing the WCS for different turning operations. My millturn machine has left spindle and right spindle. When I'm programing the toolpaths, I prefer to use different WCS for turning operation different spindle. For Milling operations, I can change the WCS easily. For turning, I can't figure out how to do that. But I know somebody can. I got a program from other guy. The turning operations are using 2 different WCS. Another question which is regarding to the WCS is that I always get a warning message telling me I have WCS is different from stock view when I open the program. The operations using different WCS are the milling operations in fact. How can I avoid this message. Thanks in advance. Sigma
  4. No, it doesn't like that. The lines on the page: His Program cannot display the webpage ____________________________________________ Most likely causes: .You are not connected to the Internet. . The website is encoutering problems. . There might be a typing error in the address. What you can try: . Check your Internet connnection. Try visiting another website to make sure you are connected. . Retype the address. . Go back to the previous page. More information BTW, anybody can tell me how to post a image from my local computer not from another hyperlink. Thanks!
  5. I'm working on Vista. I didn't find the Unblock button. I installed from X2 to X5. I can't open this one only.
  6. Thanks. Another problem is I can't open the CHookSDK.chm.
  7. I downloaded mastercamx5-b1-sdk. When I was trying to build my app. I noticed something. 1. I have to update my VS2008 with SP1. Otherwise you will got std::tr1::shared_ptr problem. 2. I had to manully include the header file: #include "ToolPrmClass_LCH.h" in header file "ToolPg_LCH.h" It maybe helpful to you.
  8. Thank you, Thad. Unfortunetly, I am developing a C-Hook. I can't take your method in my software. It is very interesting to know this software you recommended. I will try it in some other situations. Thanks again.
  9. Hello! My problem is that when I select partial operations to generate NCI file, I alway got the "Partial NCI output file" message. How can I get rid of it. For Example: I have a program which has more than one operations. I just want to post-process the first 2 operations. I have the following code: code: operation *temp_op = NULL; for (int i=0; i<TpMainOpMgr.GetMainOpList().GetSize(); i++) { temp_op = TpMainOpMgr.GetMainOpList().GetAt(i); temp_op->db.select_flag = (i<2)? TRUE:FALSE; } post_dlg_settings ps; ps.description = FALSE; ps.editNC = FALSE; ps.editNCI = FALSE; ps.export_oplist = FALSE; ps.export_prm = FALSE; ps.overwrite_nc = FALSE; ps.overwrite_nci = TRUE; ps.save_nc_file = FALSE; ps.save_nci_file = TRUE; ps.send_to_machine = FALSE; ps.wcs_1014 = TRUE; char pf[MAX_PATH]; char ncdir[MAX_PATH] = "C:"; strcpy_s(pf, PostProcFileStr(NULL, NULL, NULL, NULL)); postOps(&ps, pf, ncdir, FALSE, TRUE); Any suggestion will be appricated. Thanks!
  10. Sorry for smokey_44. I stopped this application by NetHook(VB). I have trouble in retrieving operation list from Mastercam. I can do it By C-Hook. I have been so busy for this year. My manager isn't happy with me if I do something else. Another problem is that I can't upload any file to outside of the company because of the security reason. I'm trying to find another solution. Sorry for everybody to let you wait a long time.
  11. quote: after processing the last group, pGroup was set to NULL without any error. But I will change my loop to check for the number of groups. The reason I did it that way was that the code needs to work for X, X2, X3 and X4. Would you mind tell me how to integrate all the projects together. I have to develop the C-Hooks for X2 and X3 in VS2005, and these for X4 in VS2008. It is very good to keep them together especially in one solution. Can I use VS2008 to develop C-Hooks for X/X2/X3. Sorry for interupting your thread.
  12. What I did for X4 is as following: code: op_group *cur_group = NULL; for(int i=0; i<TpMainGrpMgr.GetMainGrpList().GetSize(); i++) { cur_group = TpMainGrpMgr.GetMainGrpList().GetAt(i); // Process_Function(cur_grop); } It works well.
  13. Thank you for your reply. For the operation list, I still have one question. If I use the following codes to get the operation list, the returned operations don't contain some operations such as "Manual Entry". code: For Each op As Mastercam.Database.Operation In SearchManager.GetOperations() I would like to know if I can get all the operations in the operation manager. Further more, how can I retrieve the VIEW name if I know the view number.
  14. I'm working with NETHook2_0.dll. I tried VB2005 and VB2008. I have the following codes to retrieve the group list and operation list in the operation Manager. code: Dim group_list() as Mastercam.Support.Group group_list = Mastercam.Support.SearchManager.GetGroups() Dim op_list as Mastercam.Database.Operation op_list = Mastercam.Support.SearchManager.GetOperations() for group_list, I got nothing. for op_list, I can retrieve the operations, except the user-defined operation such as Manual Entry. My questions are: 1. how to retrieve the tool-path group list? 2. how to retrieve the user-defined operations? Thanks in advance.
  15. I mean I have to maintain the X2/X3 C-Hooks in VS2005, and X4 C-Hooks with VS2008. It isn't convinent. Certainly all the VSs can be installed on a system. As matter of fact, I have MFC6, MFC8, MFC9 in my system. Thank you for your reply.
  16. Thank you for your reply. Roger. I tried to use VS2005 for X4. It dosen't work. I installed the VS2008, updated my codes and recompiled it. It works well. It's no good to keep both VS 2005 and VS2008 at same time. But I have to. I have to develop and maintain the C-Hooks for X2/X3/X4 together. Thank you again.
  17. I'm working with MFC and XML. My C-Hook call the XML to retrieve/save all the setup information. It's not a big issue. 1. insert the line below DLL_PROCESS_ATTACH in the DllMain(...) to initialize COM code: CoInitialize(NULL) 2. insert the line below DLL_PROCESS_DETACH in the DllMain(...) to release the COM. code: CoUninitialize 3. Read/Write/Manage the XML. code: //Read XML CComPtr<IXMLDOMDocument> spDoc; //DOM spDoc.CoCreateInstance(CLSID_DOMDocument); VARIANT_BOOL vb; spDoc->load(CComVariant(OLESTR("stocks.xml")), &vb); //Load XML file CComPtr<IXMLDOMElement> spRootEle; spDoc->get_documentElement(&spRootEle); //Root Node CComPtr<IXMLDOMNodeList> spNodeList; spRootEle->get_childNodes(&spNodeList); //Child node list long nLen; spNodeList->get_length(&nLen); //number of child nodes for (long i = 0; i != nLen; ++i) //go through child nodes { CComPtr<IXMLDOMNode> spNode; spNodeList->get_item(i, &spNode); ProcessNode(spNode); //Process the node - your own funcion } //Writing into XML CComPtr<IXMLDOMNode> spNode; spRootEle->selectSingleNode(OLESTR("/root/node1"), &spNode); spNode->put_text(OLESTR("newText")); spRootEle->selectSingleNode(OLESTR ("/root/node2/childnode1/@attrib1"), &spNode); spNode->put_nodeValue(CComVariant(OLESTR ("newValue"))); CComPtr<IXMLDOMNode> spNewNode; spDoc->createNode(CComVariant(NODE_ELEMENT), OLESTR("childnode3"), OLESTR(""), &spNewNode); spRootEle->selectSingleNode(OLESTR("/root/node2"), &spNode); spNode->appendChild(spNewNode, &spNewNode); spNewNode->put_text(OLESTR("childtext2")); CComQIPtr<IXMLDOMElement> spEle = spNewNode; spEle->setAttribute(OLESTR("attrib1"), CComVariant(OLESTR("value1"))); spDoc->save(CComVariant(OLESTR("stocks.xml"))); void ProcessNode(CComPtr<IXMLDOMNode>& spNode) { CComBSTR bsNodeName; spNode->get_nodeName(&bsNodeName); AfxMessageBox(COLE2CT(bsNodeName)); CComVariant varVal; spNode->get_nodeValue(&varVal); AfxMessageBox(COLE2CT(varVal.bstrVal)); DOMNodeType eNodeType; spNode->get_nodeType(&eNodeType); if (eNodeType == NODE_ELEMENT) { CComPtr<IXMLDOMNamedNodeMap> spNameNodeMap; spNode->get_attributes(&spNameNodeMap); long nLength; spNameNodeMap->get_length(&nLength); for (long i = 0; i != nLength; ++i) { CComPtr<IXMLDOMNode> spNodeAttrib; spNameNodeMap->get_item(i, &spNodeAttrib); ProcessNode(spNodeAttrib); } CComPtr<IXMLDOMNodeList> spNodeList; spNode->get_childNodes(&spNodeList); spNodeList->get_length(&nLength); for (long i = 0; i != nLength; ++i) { CComPtr<IXMLDOMNode> spChildNode; spNodeList->get_item(i, &spChildNode); ProcessNode(spChildNode); } } } code: stocks.xml: <?xml version="1.0" encoding="utf-8"?> <root> <node1>text1</node1> <node2> <childnode1 attrib1="value1" attrib2="value2"/> <childnode2 attrib1="value1" attrib2="value2">childtext1</childnode2> </node2> </root>
  18. smokey_44 if you want, send me your exact requirements to me by email. I will give you some advice for that.
  19. I don't think it is a big problem. I think I can finish this in couple hours.
  20. Hi, all I was told the Mastercam X4 was developped by VS2008. I would like to know if we can use the VS2005 to develop the C-Hook application for X4, or I have to update my programming tool to Visual Studio2008 with no choice. Thanks!
  21. I did something like what you mentioned before. It isn't a very small project. So I don't think you can get it with one or more replies.
  22. I think it is very easy to go through the DB. Here we go: code: DB_LIST_ENT_PTR d_ptr = db_start; CString tempStr; ent entity; CList<CString, CString&> entList; do { get_ent_from_eptr(d_ptr, &entity); tempStr.Format(_T("idn: %d, ID: %d"), entity.ent_idn, entity.id); entList.AddTail(tempStr); d_ptr=d_ptr->next; }while( d_ptr != db_end); POSITION pos; if (entList.GetCount() >0 ) { pos = entList.GetHeadPosition(); while(pos) { tempStr = entList.GetAt(pos); AfxMessageBox(tempStr); entList.GetNext(pos); } } I retrieved all the entity's ent_idn and ID, and store them in a CList. Then show them one by one. The only problem of this code section is it is no good when there is nothing in DB_LIST. But It seems impossible, even it is an empty program.

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