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:

SearchManager.GetOperations disable some operations. Is this normal?


Recommended Posts

Hi.
The interface we are developing requires retrieving information from mastercam operations.
We use SearchManager.GetOperations() but that seems to disable some operations.
However, our interface must not modify the model.
Is this normal? The SearchManager.GetOperations() function is it not supposed not to modify the model?
Do you have a solution to avoid this issue?
Thanks !

Link to comment
Share on other sites
8 minutes ago, Deflandre JY said:

Hi.
The interface we are developing requires retrieving information from mastercam operations.
We use SearchManager.GetOperations() but that seems to disable some operations.
However, our interface must not modify the model.
Is this normal? The SearchManager.GetOperations() function is it not supposed not to modify the model?
Do you have a solution to avoid this issue?
Thanks !

Please, always  include which version of Mastercam you are using.

Can you share a code snippet or description of what you are trying to do?

Calling Commit() may dirty the operation. Keep in ming the NEThook api does not have wire edm or lathe support.

Link to comment
Share on other sites

Hi,
We are using Mastercam 2021, we have the same with Mastercam 2020 .

We see this problem by running only the code below. Otherwise, the goal is to retrieve for each operation information such as  Tools used,  planes and axis.


        Group[] aGroups = SearchManager.GetGroups();
        foreach (Group oGroup in aGroups)
        {
            if (oGroup.GetParentGroup() != null)
            {
                if (oGroup.IsToolpathGroup())
                {
                    if (oGroup.Name != null)
                    {
                        List<Operation> aOperations = new List<Operation>();
                        if (SearchManager.IsAnyOperations(oGroup.ID))
                        {
                            Operation[] aOperations1 = SearchManager.GetOperations(oGroup.ID);
                            foreach (Operation oOp in aOperations1)
                                aOperations.Add(oOp);
                        }
                    }
                }
            }
        }

Link to comment
Share on other sites
11 minutes ago, Deflandre JY said:

Hi,
We are using Mastercam 2021, we have the same with Mastercam 2020 .

We see this problem by running only the code below. Otherwise, the goal is to retrieve for each operation information such as  Tools used,  planes and axis.


        Group[] aGroups = SearchManager.GetGroups();
        foreach (Group oGroup in aGroups)
        {
            if (oGroup.GetParentGroup() != null)
            {
                if (oGroup.IsToolpathGroup())
                {
                    if (oGroup.Name != null)
                    {
                        List<Operation> aOperations = new List<Operation>();
                        if (SearchManager.IsAnyOperations(oGroup.ID))
                        {
                            Operation[] aOperations1 = SearchManager.GetOperations(oGroup.ID);
                            foreach (Operation oOp in aOperations1)
                                aOperations.Add(oOp);
                        }
                    }
                }
            }
        }

Yes, you don't want to be using the Add method here.

oOp already contains the operation info, for specific supported types you can get the type and cast it as eg. circlemill contour drilling pocket or nesting.

Link to comment
Share on other sites
//get a list of the nethook supported lists in mastercam
var List = Mastercam.Support.SearchManager.GetOperations();
//loop through the list of operations
foreach(var operation in List)
{
//if the operation type is not nesting
if (operation.Type.ToString() != "Nesting")
     {
         //get the operations toolnumber
         var tlnum = operation.OperationTool.Number;
         //write the tool number to mastercams event logger
         Mastercam.IO.EventManager.LogEvent(Mastercam.IO.Types.MessageSeverityType.InformationalMessage,""," ToolNumber : " + tlnum.ToString() + " ");
         //write the operation type to mastercams event logger
         Mastercam.IO.EventManager.LogEvent(Mastercam.IO.Types.MessageSeverityType.InformationalMessage,"","Op Type : "+ operation.Type.ToString());
          //write the operation id and cycletime to mastercams event logger
         Mastercam.IO.EventManager.LogEvent(Mastercam.IO.Types.MessageSeverityType.InformationalMessage,""," OpID : " + operation.GetOperationID().ToString() + " Time : " + operation.CalcCycleTime().ToString() + " TlNum : " + operation.OperationTool.Number.ToString());
     }

}

 

Link to comment
Share on other sites

Hi.

Thank you for your answers, but that was not really the subject of my question.

I've minimized my code as below. Only one call to GetOperations(). And this disables an operation. I just wanted to know if it's normal for a "Get..." function to do this and how to find out why my operation is disabled.

        public override MCamReturn Run(int param)
        {
            var List = Mastercam.Support.SearchManager.GetOperations();
            return MCamReturn.NoErrors;
        }

Thanks.

Link to comment
Share on other sites
23 minutes ago, Deflandre JY said:

Hi.

Thank you for your answers, but that was not really the subject of my question.

I've minimized my code as below. Only one call to GetOperations(). And this disables an operation. I just wanted to know if it's normal for a "Get..." function to do this and how to find out why my operation is disabled.

        public override MCamReturn Run(int param)
        {
            var List = Mastercam.Support.SearchManager.GetOperations();
            return MCamReturn.NoErrors;
        }

Thanks.

 I see,

I haven't seen this before,

can you describe what exactly you mean by "operation is disabled"?

What is the name of the affected operation?

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