Roger Martin from CNC Software

CNC Software
  • Content count

    2,782
  • Joined

  • Last visited

Community Reputation

89 Excellent

4 Followers

About Roger Martin from CNC Software

  • Rank
    Advanced Member

Recent Profile Visitors

3,062 profile views
  1. Roger Martin from CNC Software

    Dynamically Load Dll Functions from Text File Info

    I don't believe so. Mastercam is concerned the the DLL specified in the FT file Now depending on how any other DLLs the (FT listed) DLL uses and how they are loaded/referenced may have an effect. There are 2 versions of RunUserApp in the SDK . (Declared in interfaces\GUI\RunApp_CH.h)
  2. Roger Martin from CNC Software

    Dynamically Load Dll Functions from Text File Info

    #if defined(_AFXEXT) || defined(_AFXDLL) // Use the AFX versions of LoadLibrary/FreeLibrary #else // Use the standard versions of LoadLibrary/FreeLibrary #endif Maybe this? - If a DLL is referenced (loaded) in a Function Table (FT) file, it cannot be unloaded while Mastercam is running.
  3. Roger Martin from CNC Software

    Dynamically Load Dll Functions from Text File Info

    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
  4. Roger Martin from CNC Software

    exchange tool with mastercam

    Marie, Yes, I did and I forwarded it to our Tool Team. It's my understanding that someone on that Team will be contacting you.
  5. Roger Martin from CNC Software

    exchange tool with mastercam

    Marie, Send us details of what you are wanting to do with Tools, along with your company contact information to -> [email protected]
  6. 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.
  7. Roger Martin from CNC Software

    Multi language Application

    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!
  8. Roger Martin from CNC Software

    Accessing non reserved planes with C++ SDK

    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; }
  9. Roger Martin from CNC Software

    c# dynamic keyword equvalent in c++/cli

    Maybe? What is C# dynamic keyword equivalent in C++ CLI? https://stackoverflow.com/questions/15359802/what-is-c-sharp-dynamic-keyword-equivalent-in-c-cli
  10. Roger Martin from CNC Software

    Accessing non reserved planes with C++ SDK

    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”
  11. Roger Martin from CNC Software

    Nethook Nesting : C++/CLI

    No - Memory for a managed type (reference or value type) that is allocated by gcnew, and is deallocated by using (automatic) garbage collection.
  12. Roger Martin from CNC Software

    Nethook Nesting : C++/CLI

    Your array items are null - array<Mastercam::Nesting::NestingPart^>^ partArray; // Not gcnew initialized nestingfile->PartArray = partArray; array<Mastercam::Nesting::NestingSheet^>^ sheetArray; // Not gcnew initialized nestingfile->SheetArray = sheetArray;
  13. Roger Martin from CNC Software

    Custom Setup Sheet Data from NC FILE C# :

    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; }
  14. Roger Martin from CNC Software

    Chook Question : Simplify Spline

    Converting a single Spline to a single arc? -or- Simplifying a Spline to possibly multiple arcs and/or lines?
  15. NO. The .FT (Function Table) files must be located in Mastercam's \chooks folder. Your add-in DLLs can be located wherever you wish, as the the data in the .FT file tells Mastercam where to find it.

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