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:

Generating drill toolpaths is locking depth


Recommended Posts

About done with a "hook" that allows me to pick drill points once and generate spot, drill, and tap cycles in one shot.  I have it all working except this last bit.

Currently copy drill points from first generated operation for the other two, but this is resulting in the locking of the depth field within Mastercam's toolpath manager window.  The values set via code are correct, but greyed out and always post as if the depth was Z0.

 

Have fiddled around quite a bit but I cannot get this solved.  I appreciate the time and advise.

Link to comment
Share on other sites

Fresh eyes in the morning sorted it.  I was iterating over the list of drill points and adding them to the next operation.

Seems my error was adding them as references.  Creating new drill point objects using the ArcData or PointData from the points in the first operation cleared it right up.

 

Thanks again.

Link to comment
Share on other sites

If you are just wanting to replicate the DrillPoints from one operation into another.
There is built in functionality to do this.
Below is a somewhat contrived example.
It copies all the points in the 1st operation into the 2nd operation, replacing the points in the target operation.
“CopyDrillPointsFromOp” is a member function of a DrillBasedOperation 
(since it only works with “point” type operations), 
so we need to do the casting of the Operation(s) to the DrillBasedOperation type.
 

bool result = false;
var drillOPs = Mastercam.Support.SearchManager.GetOperations(OperationType.Drill);

if (drillOPs.Length > 1)
 {
 bool replacePoints = true;
 result = ((DrillBasedOperation)drillOPs[1]).CopyDrillPointsFromOp((DrillBasedOperation)drillOPs[0], replacePoints);
 }

if (result)
 {
 result = drillOPs[1].Regenerate();
}

 

Link to comment
Share on other sites
  • 5 years later...

I have been searching about this topic, I need change de number of drill list item. If it is the first index, change to the second  one or other. How can I access to that part of the drill operation data?

Sorry for my English

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