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:

Nethook for unselecting posting Off operations


Recommended Posts

Hello

 

I am trying to write a simple utility which would unselect ALL operations that are marked as Posting OFF:

 

acidhafa.png

 

Here is the code sample I wrote:

public static MCamReturn RunPostingOffUnselect()

{

Operation[] FoundOperations = SearchManager.GetOperations(); // get all the operations

 

foreach (Operation CurrentOperation in FoundOperations)

{

if ((CurrentOperation.Posting == false) && (CurrentOperation.Selected == true)) // find all operations that are POSTING OFF and SELECTED

{

CurrentOperation.Selected = false; // Change the SELECTED state to UNSELECTED

 

CurrentOperation.Commit(); // !!!! THIS IS THE ISSUE - it commits the operation to unselected state (this part is OK)

// but it also make it DIRTY (I do not want to have a dirty operation - this part is NOT OK)

// If I do not use this line the operation does not get unselected

}

}

OperationsManager.RefreshOperationsManager();

return MCamReturn.NoErrors;

 

}

 

The issue is presented in the code (as a comment with a CurrentOperation.Commit() function.

 

I would greatly appreciate if you could help me regarding this issue. I hope this can be solved just with .Nethook functions.

 

Best regards.

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