-
Posts
2,870 -
Joined
-
Last visited
-
Days Won
6
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Everything posted by Roger Martin from CNC Software
-
The CycleTime add-in can be used with or without a post processor. When using it with a post, you are calling it from the PST and you get the back the time that you can then output in comments in the NC file. You can also get times running this add-in from Mastercam’s user interface. You add the CycleTime Add-In command to the UI and when run it will get the time for all ‘selected’ (and clean!) operations. The times that it gets are the same has what you would see if you did a Setup Sheet. See the CycleTime.pdf for more details.
-
Toolpath Organizing/Naming
Roger Martin from CNC Software replied to [email protected]'s topic in Industrial Forum
By this I assume he is referring to the Comment "box" on the Tool page within the operation’s parameters. You can certainly do that, but to enter that text with less clicking. In the toolpath tree, either... Do a single left-click on the operation’s name and wait a second. (The "name" to the right of the folder icon in the tree.) -or- With the toolpath name selected (highlighted), press F2 An edit box will appear where you can enter the desired "comment" text. -
MC 2021 issues with flats when cutting curves
Roger Martin from CNC Software replied to jim1960's topic in Industrial Forum
The arcs in your chain are in View #21 and #22. How did they get there? If you create new “Plane from Geometry? and select one of the arcs and display the plane’s gnomon, you will see the issue. You can "Transform-Translate to Plane" to reorient them to Top. First, create a point at the center of the left-end arc. We will use that as the Rotation Center Point. Now do the Translate to Plane… Select the arcs to be moved. For the Source Plane select the “Unnamed plane ##” at the bottom of the list. (If may already be the Source setting as it read it from the selected geometry.) For the Destination Plane select “Top”. Now in Center of Rotation select the center point you created for both the Source and Destination, Click OK (green check) to perform the Translate operation. You can verify the arcs with Analyze (F4) to confirm that they are now in View #1 (Top). Now do Rechain All in the operation to select the relocated geometry. Regenerate the path and you should get G2/G3 arc motion in the NC output . -
NET-Hook API Docs On the "Welcome to the Mastercam NET-Hook API" page you will see a link to the ToolNetAPI docs. Check the "Version History" page of the ToolNetApi docs. public TlToolMill GetMillingTool(Operation operation) { // Prior to Mastercam 2021 -> //var toolSystem = TlToolFunctions.GetToolSystem(); // In Mastercam 2021 the 'TlToolFunctions' has been replaced with 'TlServices' // and now you can retrieve the 'tool systems' or // create 'factories' using the methods exposed in this service. var toolSystem = TlServices.GetIToolSystem(); var toolAssembly = new TlAssembly(); toolSystem.Find(operation.OperationTool.Slot, ref toolAssembly); return toolAssembly.GetMillTool(); }
-
SearchManager in the NET-Hook API currently only supports Mill type operations. A simple C++/CLI project that creates an interop DLL that your NET-Hook add-in can use would be simple to create. You would add a reference to this DLL. just like you do for the NETHook3_0.DLL to get access to the functionality in the standard API. I have such a project. If you email -> SDK.mastercam.com and let us know you company contact information and what version of Mastercam this is for, I can probably set you up. It appears you are looking for these data items in each operation - Operation Name (comment) Operation ID (number) Operation Type ("type" code) Operation Tool Number (and probably also the Tool Slot Number) “Toolpath Visibility” status “IsDirty” status “Selected” status “Posting” status (Is the operation ghosted?) *Are there more?
-
The SelectionManager.BoxSelectGeometry method does not provide access to the (2) corners of the user sketched window. There is the SelectionManager::WindowSelect method where your NET-Hook supplied the corner of the window. The first question would be, exactly what are you wanting to do using the UIEventData Class? (You almost always use this along with a modeless dialog.) I have a (C#) NET-Hook project the uses a GetEvent loop. If you email us with your company contact to [email protected] we can get you a copy of this sample project.
-
Though I cannot say I know exactly what you're doing here. It seems like a lot of code for just for doing: LoadLibrary / GetProcAddress BTW - If you're running this in a Mastercam add-in, your add-in is "MFC", so it's better to use -> AfxLoadLibrary & AfxFreeLibrary https://docs.microsoft.com/en-us/cpp/build/loadlibrary-and-afxloadlibrary?view=vs-2019 This - #ifdef UNICODE //Test to see if we're using wchar_ts or not. LPCWSTR lpszFuncName = NULL; #else LPSTR lpszFuncName = NULL; #endif Could be replaced with -> LPCTSTR lpszFuncName = NULL; LPCTSTR - An LPCWSTR if UNICODE is defined, an LPCSTR otherwise. https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
-
Marie, Send us details of what you are wanting to do with Tools, along with your company contact information to -> [email protected]
-
Yes, if it cannot find the Resources specified in the FT file if will complain about that in the LOG. Something like -> ERROR (L49,C:\Program Files\Mastercam 2020\Mastercam\CHOOKS\MC_MultilingualAPP.ft): Unable to open resource module CHOOKS\PROJECT_NAME.dll. Yes, here I've launched a NET-Hook Add-In (RunUserDefined is the method that was called in the DLL) -> NET-Hook function launched: C:\Program Files\Mastercam 2020\Mastercam\CHOOKS\NETHOOKSATELLITEASSEMBLYLANGUAGES.dll::RunUserDefined You'll get something very similar for a C-Hook Add-In. Have you tried running your add-in in DEBUG? If you set a breakpoint on in the entry point function of you add-in, it should get hit.
-
LMVUICHARD, The different language-specific resources can be -> In separate satellite DLLs placed in sub-folders such as "en-US" and "fr-FR", or they can by embedded directly into the NET-Hook add-in DLL. How you retrieve those resources will depend on which method you use. Either through you dealer create a support ticket, or email us directly sdk[at]mastercam[dot]com with you company contact information so we can create the ticket, and we can help you out!
-
This will work in Mastercam 2019 This exact code will not be valid for Mastercam 2020/2021. It will very similar in 2020/2021, but getting the list of Planes to search is done differently. /// <summary> Gets the Plane ID of the "named" Plane for a View number. </summary> /// /// <remarks> A View# may not necessarily have an associated "named" Plane! </remarks> /// /// <param name="viewNumber"> The View Number to search for. </param> /// /// <returns> The Plane ID (0 = no match found). </returns> long GetPlaneID (short viewNumber) { auto id = 0; PLANES_NAMED_PTR_ARRAY planesArray; auto count = Planes.GetPlanes (planesArray); for (auto i = 0; i < count; ++i) { auto plane = planesArray.GetAt (i); if (plane->GetShortViewNo () == viewNumber) { id = plane->GetLongID (); break; } } (id > 0) ? TRACE (_T ("View#:%i matches named Plane ID#:%i"), viewNumber, id) : TRACE (_T ("No named Plane match found for View#:%i"), viewNumber); return id; }
-
Planes Always remember that -> View ID != Plane ID What you see in the Planes Manager are the “named” Planes. An arc does not necessarily have a “named” Plane associated with it! If you pass a valid Plane ID, you will get the Plane. It appears that that you are probably passing the “View Number” from the arc entity. const Plane *arcPlane = Planes.GetPlanePtrByID(22); //get Plane No. 22 That’s either - not going to retrieve anything, and the acrPlane will be null, (Which you should always check before attempting to dereference a pointer.) or you could possibly get Plane that is not associated with the view that arc in is. To get a “named” Plane you pass the “ID”, which for the View Number “22” you show would be “52”
-
Instead of you stepping though all of the entities, let Mastercam do that work for you. get_raw_ent is just like get_ent, except you can control whether of not the entities must be visible to be "seen" by the get functionality. Both only retrieve ALIVE entities of the requested type. std::vector<DB_LIST_ENT_PTR> GetAllSolids () { std::vector<DB_LIST_ENT_PTR> dblistptrvector; auto onlyVisible = false; auto succf = false; ent entity; DB_LIST_ENT_PTR foundPtr; DB_LIST_ENT_PTR eptr = db_start; do { get_raw_ent (onlyVisible, &eptr, &foundPtr, &entity, 0, SOLID_ID, &succf); if (succf) { if (sel_bit_is_off (&entity, BLANK_BIT)) { dblistptrvector.push_back (foundPtr); } } } while (succf); if (!dblistptrvector.empty ()) { repaint_graphics (); } return dblistptrvector; }
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.