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:

Recommended Posts

Hi guys, I try to reverse chain.  For the first operation the user select counter clockwise chain but the second operation it the same chain but clockwise. I try to reverse or change Direction but it doesn't works.

Chain[] Uchain = ChainManager.GetMultipleChains("Selection du parcours a machiné", true);
                Chain rchain;
             
                foreach (Mastercam.Database.Chain nchain in Uchain)
                
                {
                    
                    ChainDirectionType rev = ChainDirectionType.Clockwise;
                    nchain.Direction = rev;
                  
                    

                   

                } 

It's contour operation. I have MX6 and I use VS 2010

 

Thanks

 

 

 

Link to comment
Share on other sites

here is my code

  private void mm3deg3_Click(object sender, EventArgs e)
        {
            {
                //1/8-3DEG

                Chain[] Uchain = ChainManager.GetMultipleChains("Selection du parcours a machiné", true);
                Chain rchain;
             
               

                string ncname = "";
                string opname = "1/8-3DEG-1";
                double depthdiff;
                double mindepth;
                bool result;
                depthdiff = System.Convert.ToDouble(label2.Text);
                mindepth = System.Convert.ToDouble(label1.Text);
                {

                    Mastercam.Operations.ContourOperation op = contour(opname);
                    int count = contourchain(op, depthdiff, false, mindepth, ncname, "", Uchain);
                    if (count > 0)
                    {
                        result = op.Regenerate();
                       
                    }
                }
                opname = "1/8-3DEG-2";
                Mastercam.Operations.ContourOperation op2 = contour(opname);
                int count2 = contourchain(op2, depthdiff, true, mindepth, ncname, "", Uchain);
                if (count2 > 0)
                {
                    result = op2.Regenerate();

                }
                opname = "FC 1/8-3DEG";
               
               
                Mastercam.Operations.ContourOperation op3 = contour(opname);
                int count3 = contourchain(op3, depthdiff, true, mindepth, ncname, "", Uchain);
               
                foreach (Mastercam.Database.Chain nchain in Uchain)
                {
                    ChainDirectionType rev = ChainDirectionType.Clockwise;
                    nchain.Direction = rev; 

                    // here I want to remove chain point
                    
                }

                
                
              
                op3.Commit();
                op3.Regenerate();

                mm4deg5.Focus();
            }
        }
Link to comment
Share on other sites

Seb,

 

Give this a try, I haven't been able to test as I am in the middle of something else but it might help.

            opname = "FC 1/8-3DEG";
            var op3 = this.contour(opname);
            var count3 = this.contourchain(op3, depthdiff, true, mindepth, ncname, string.Empty, uchain);

            foreach (var nchain in uchain)
            {
                nchain.Direction = ChainDirectionType.Clockwise;
            }

            op3.CutterComp = CutterCompType.CutterCompRight;

            ChainManager.StartChainAtLongest(uchain);
            ChainManager.SortChainsByArea(uchain, true); // Flip true/false accordingly

            op3.Commit();
            op3.Regenerate();

            this.mm4deg5.Focus();

Link to comment
Share on other sites

 

Seb,

 

Give this a try, I haven't been able to test as I am in the middle of something else but it might help.

            opname = "FC 1/8-3DEG";
            var op3 = this.contour(opname);
            var count3 = this.contourchain(op3, depthdiff, true, mindepth, ncname, string.Empty, uchain);

            foreach (var nchain in uchain)
            {
                nchain.Direction = ChainDirectionType.Clockwise;
            }

            op3.CutterComp = CutterCompType.CutterCompRight;

            ChainManager.StartChainAtLongest(uchain);
            ChainManager.SortChainsByArea(uchain, true); // Flip true/false accordingly

            op3.Commit();
            op3.Regenerate();

            this.mm4deg5.Focus();

Yes it'S works thanks

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