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:

sapin

Verified Members
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sapin's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi. I notice the class Cnc.Tool.Interop.TlToolFunctions was removed in Mastercam 2021 version. In a previous topic, Roger Martin send me a code sample using this class. /// <returns> The profile is here is one, else null. </returns> private TlProfile GetProfile(int toolNumber) { var ts = TlToolFunctions.GetToolSystem(); Any advice to replace this "TlToolFunctions.GetToolSystem();" with mcam 2021 ? Thanks !
  2. Sorry, but what is iCentral system ? When I log into user.mastercam, I only have acces to a forum. Thanks
  3. Hi, I still got this issue. Someone have any idea to fix this ? Thanks
  4. Is my issues more clear ? Does anyone have an idea to fix it ? or have the same issues ?
  5. Hi Mick, It will be hard to send the project. I tried to make an picture who describe my issue. Regards,
  6. Hi, I am running a modeless dialog box througth "public override MCamReturn Run(int param)". In this dialog box, I got some edit text. While my dialog box have the focus, if the user press "space" or "suppr", this will interact with mastercam ("suppr" key will launch the delete entity scenario for exemple). Did I miss any trick to fix this point ? Regards,
  7. Ok, so. First of all, my english is not really good, sorry for that. I probably don't understand your request. Second, when I say "close this topic", it's not "delete this topic". It's something as "mark as resolved" to explain this point is resolved. Third, my question was "How to get the tool custom stored profiled ?" and the code sample given by Roger Martin is just good. I just copy and past it and I can access to the stored profil. So, is someone need help, just take a look to Roger Martin answer. So the community can have all benefit to Roger Martin precious help, and I don't keep anything too me as I wasn't able to solve this problem alone. Regards,
  8. Thanks for your help, I am now able to get the stored profil. You can close this topic if you want.
  9. Well, thank you very much for you help Roger. I will try this during this week but I am sure this will work. Best regards
  10. Hello, I am still not able to get the stored profil of a tool. Join to my post a sample, a simple mcam file with only one tool (a pic of this tool is in my first post). This tool as a stored profile ( HasStoredProfile() return an TlProfile) but without any segment ( profile.GetSegmentCount() == 0). So, I am really confused, and now I don't know what to do. Here is the code I made, By the way, I also get an expection in the "tlToolMill.GetProfile();" call. Can anyone help me to solve this problem ? Thank you. PSA_sample.mcam
  11. "I would also check profile for null before calling GetSegmentCount just to be safe, if it is null that could be an indication of a problem." Done, but the exception is in the "tlToolMill.GetProfile();" function. "Try restarting Mastercam and see if you can reproduce this issue." I can reproduce the issue every time. I try my code with some other mastercam files. I got 3 kinds of result. The listAssembly count = 0 in some case. Even if got some assemblies in my toolManager. The listAssembly != 0, then I trying to access to the tool profile -> 2 cases : Everything is going fine, my profile.GetSegmentCount() > 0 Or I got an exception during GetProfile(); function. I think I am not doing this in the rigth way. Any documentation about the ToolNetApi.dll ? I didn't find any manual or samples in the mastercam website. Regards,
  12. So, I made some quick test and got something really strage. In some case, I get the TlProfile, and in other case I got a C# exception during the "GetProfile()" function. Here is my code. private void _GetProfile(Mastercam.Database.Tool Tool) { Cnc.Tool.Interop.ToolLibrarySystem mTlib = new ToolLibrarySystem(); if ( mTlib.OpenLibrary(Mastercam.IO.FileManager.CurrentFileName, false) ) { List<TlAssembly> listAssembly = new List<TlAssembly>(); mTlib.GetAllTlAssemblies(listAssembly); foreach (TlAssembly assembly in listAssembly) { if (assembly.HasMainTool()) { TlToolMill tlToolMill = new TlToolMill(); tlToolMill = assembly.GetMillTool(); if (tlToolMill != null && tlToolMill.ToolNumber == Tool.Number) { try { TlProfileResult result = tlToolMill.GetProfile(); TlProfile profile; if (result.resultCode == TlProfileResultCode.NoError) { profile = result.profile; // Profile data back to caller int sgmentCount = profile.GetSegmentCount(); } } catch (Exception oException) { __oLog.ForceLog(oException.Message); } } } } } The exception message is : "Tentative de lecture ou d'écriture de mémoire protégée. Cela indique souvent qu'une autre mémoire est endommagée." who is probably "Attempted to read or write protected memory. This is often an indication that other memory is corrupt" Any idea for how to fix this error ? Thank again.
  13. Looks great. I wil try this solution. I just need to find who to retrieve an TlAssembly from a MasterCam.Data.Tool. Thank for your help.
  14. Hi, I am trying to get the stored profile of a tool from the mastercam NET-Hook or C-Hook. In Net-hook, I think the profile is in the Cnc.Tool.TlProfile but i don't know how to access it from the Mastercam namespace. In C-Hook, I think I can access to the profile by the GetStoredProfile() function in TlProfilePtr but I actually don't know how to get an TlProfilePtr from a tool number. Is there any samples or documentation to help me ? I checked the 3rd party developers data but I probably miss something. Thanks !

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