sigmawave
Verified Members-
Posts
69 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Everything posted by sigmawave
-
Question about the WCS change for turning operations
sigmawave replied to sigmawave's topic in Industrial Forum
-
Question about the WCS change for turning operations
sigmawave replied to sigmawave's topic in Industrial Forum
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! -
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
-
X5 SDK issues I found.
sigmawave replied to sigmawave's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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! -
X5 SDK issues I found.
sigmawave replied to sigmawave's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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. -
X5 SDK issues I found.
sigmawave replied to sigmawave's topic in Mastercam C-Hook, NET-Hook and VBScript Development
Thanks. Another problem is I can't open the CHookSDK.chm. -
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.
-
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!
-
drop down comments box ?
sigmawave replied to smokey_44's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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. -
Cycling throught groups in X4
sigmawave replied to CaKiwi's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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. -
Cycling throught groups in X4
sigmawave replied to CaKiwi's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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. -
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.
-
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.
-
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.
-
1 small question
sigmawave replied to gms1's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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> -
drop down comments box ?
sigmawave replied to smokey_44's topic in Mastercam C-Hook, NET-Hook and VBScript Development
smokey_44 if you want, send me your exact requirements to me by email. I will give you some advice for that. -
drop down comments box ?
sigmawave replied to smokey_44's topic in Mastercam C-Hook, NET-Hook and VBScript Development
I don't think it is a big problem. I think I can finish this in couple hours. -
A question about color.
sigmawave replied to sigmawave's topic in Mastercam C-Hook, NET-Hook and VBScript Development
Thank you so much Takashi! I got solution. -
How to get the type of entity.
sigmawave replied to sigmawave's topic in Mastercam C-Hook, NET-Hook and VBScript Development
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.