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:

Cnc.Tool.Interop.TlToolFunctions removed in MCam2021


Recommended Posts

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 !

Link to comment
Share on other sites

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();
        }

 

  • Thanks 1
Link to comment
Share on other sites
  • 2 months later...

This breaks the backward compatibility for toolnet api stuff tho, one of the things I like about Nethooks is that they work across many versions, I was wondering if there was a way around that, lets say I compiled two static libraries with c++/cli each with the equivalent function for 2020 and 2021, then checked the version of mastercam and based on that decided which function to call.

Sounds like it would work. Hmmmmmmm.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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