Sign in to follow this  
c++

Vbscript : Adding arcs instead of points to drilling operation

Recommended Posts

Hi, I was wondering if their is a way to add arcs instead of points to a drill op via vbscript. Here is my code for drilling :

'/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Function DrillAllAddToOperation(LevelToDrill,PathToOpLibrary,OpNameAsString,OpCommentAsString,OverRideSettings,currentview)
Call FreeChains     
Call UnselectAll      
Call RepaintScreen(True)   
Call SetCPlaneNumber(currentview)
Call SetTPlaneNumber(currentview)
Call ZeroPts
Dim SearchArcs
SearchArcs = StartDBSearch(mc_alive, mc_arctype)    
If SearchArcs Then
Do 
If Not LevelToDrill <> GetEntityLevel Then 
Dim Arc
Set Arc = New McAr
If GetArcData(GetEntityEptr, Arc) = True Then
Call AddDrillPoint (Arc.X, Arc.Y, -1) 
End If
End if
Loop While NextDBSearch   
End If  
If MakeOperationFromName(PathToOpLibrary,OpNameAsString,OpCommentAsString, OverRideSettings) <> mcOPERATION_INVALID Then
Else
End If  
Call SetCPlaneNumber(mcVIEW_TOP)
Call SetTPlaneNumber(mcVIEW_TOP)
Call ZeroPts
End Function
'/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Thank youu!

ps. I know this language is out of date but IT is having trouble download visual studio onto my machine with windows 10

Share this post


Link to post
Share on other sites

It is certainly out of date and essentially deprecated at this point but you might be able to use AddArcPoint()

 

If you open or create a VBScript in Mastercam Code Editor you will get intellisense to help find functionality.

 

 

addarcpoint.png

  • Thanks 1

Share this post


Link to post
Share on other sites
On 12/10/2019 at 10:58 AM, Mick George said:

It is certainly out of date and essentially deprecated at this point but you might be able to use AddArcPoint()

 

If you open or create a VBScript in Mastercam Code Editor you will get intellisense to help find functionality.

 

 

addarcpoint.png

Mick,

thank you.

 If I may ask another question, would it be possible to disable duplicate tool checking during makeoperationfromfilename ?

Share this post


Link to post
Share on other sites
33 minutes ago, Mick George said:

That would be a question for roger, i would ping him via [email protected]

Thank you Mick.

Share this post


Link to post
Share on other sites
17 minutes ago, Roger Martin from CNC Software said:

Peter,

See :

NET-Hook API Reference Guide
https://nethookdocs.mastercam.com

Search for: OperationsManager.ImportOperation
Note the ImportOptions that are passed to the ImportOperation method.
 

Thank you for the reply Roger,

I am looking to add an arc to an already existing drilling or circle milling/helixbore operation

Share this post


Link to post
Share on other sites

NET-Hook API Reference Guide
https://nethookdocs.mastercam.com

Search for: "DrillPoint"
See: DrillPoint Constructor (ArcGeometry)

In a "Point-Based" type operation in the NET-Hook API...
The toolpath geometry assigned to it are "DrillPoint" objects.
The operation has the "DrillPoints" member data that contains these points.

-Pseudo code-

// MyArc - is an existing ArcGeometry object.
// MyDrillOp - is a "Point-Based" type operation.

var drillPt = new DrillPoint(MyArc);
MyDrillOp.DrillPoints.Add(drillPt);
MyDrillOp.Commit();
MyDrillOp.Regenerate(); 
                        

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you very much.

Share this post


Link to post
Share on other sites
On 1/2/2020 at 1:38 PM, Roger Martin from CNC Software said:

NET-Hook API Reference Guide
https://nethookdocs.mastercam.com

Search for: "DrillPoint"
See: DrillPoint Constructor (ArcGeometry)

In a "Point-Based" type operation in the NET-Hook API...
The toolpath geometry assigned to it are "DrillPoint" objects.
The operation has the "DrillPoints" member data that contains these points.

-Pseudo code-

// MyArc - is an existing ArcGeometry object.
// MyDrillOp - is a "Point-Based" type operation.

var drillPt = new DrillPoint(MyArc);
MyDrillOp.DrillPoints.Add(drillPt);
MyDrillOp.Commit();
MyDrillOp.Regenerate(); 
                        

It works perfectly, thanks again.

 

Share this post


Link to post
Share on other sites

In my user profile these functions work well, however on 2 other users there is some undefined behavior where toolpaths are being sometimes mangled, I will probably switch to using only pocket and contour toolpaths to deal with the former helix bore, circle mill toolpaths, the drilling doesn't seem to cause a problem, but I will most likely return to the c++ point based system for drilling.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 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