Roger Martin from CNC Software

CNC Software
  • Content count

  • Joined

  • Last visited

Community Reputation

71 Excellent


About Roger Martin from CNC Software

  • Rank
    Advanced Member

Recent Profile Visitors

2,867 profile views
  1. Roger Martin from CNC Software

    Sdk installation Error

    I waiting to hear back from the installer experts as to what they think may be the issue for you. I would be worth trying to download a new copy of the SDK to install. In the CHM I searched for TP_OPCODE Then down in the list found topics selected -> ToolpathOperationCode_CHh File Reference Scroll down to the Enumerations and you'll find the enum TP_OPCODE information.
  2. Roger Martin from CNC Software

    Sdk installation Error

    That's an install error I've not seen in a long time for the SDK. Are you running Windows 7 or 10 ? Download Link -> CHookSDK CHM [2020].zip
  3. Roger Martin from CNC Software

    How to select stl mesh as drive surface

    Harsh, If you send us your contact/company details and exactly what you're wanting to do to -> SDK <at> mastercam <dot> com We can create a support ticket. Be sure to let us know what version of Mastercam !
  4. Peter, Setting the Solid in the operation is just step #1. There is a lot of processing that occurs when you OK out of the FBM Toolpath - Mill dialog. I have a feeling that accomplishing this detection/processing phase this is not possible via the public SDK. You can send us your contact/company details and exactly what you're wanting to do to -> SDK <at> mastercam <dot> com We can then create a support ticket to investigate further.
  5. Peter, From my communications with the CAD Team, this is a know issue. I'm investigating and will let you know if I find out any more information.
  6. Roger Martin from CNC Software

    VBS to NEThook question

    See - GroupManager.GetAllGroups Method in NET-Hook API Docs -> ''' <summary> The names of all the Machine and Toolpath groups. </summary> ''' <param name="machineGroupNames"> [out] A list of names of all the Machine Groups. </param> ''' <param name="toolpathGroupNames"> [out] A list of names of all the Toolpath Groups. </param> ''' <returns> The total number of groups that were processed. </returns> Private Function GetGroupNames(ByRef machineGroupNames As List(Of String), ByRef toolpathGroupNames As List(Of String)) As Integer machineGroupNames = New List(Of String)() toolpathGroupNames = New List(Of String)() Dim groups = New List(Of Group)() Dim onlyMachineGroups As Boolean = False GroupManager.GetAllGroups(groups, onlyMachineGroups) For Each grp In groups If grp.IsMachineGroup() Then machineGroupNames.Add(grp.Name) ElseIf grp.IsToolpathGroup() Then toolpathGroupNames.Add(grp.Name) End If Next Return machineGroupNames.Count + toolpathGroupNames.Count End Function
  7. Roger Martin from CNC Software

    VBS to NEThook question

    The opcode value it gives you is the same code value as in the C-Hook SDK. In the C-Hook SDK, see in \interfaces\Core\ToolpathOperationCodes_CH.h Search for this enumeration of OpCode values -> enum TP_OPCODE Just like in a C-Hook you don't get a (string) "name" like -> TP_MANUAL_ENTRY These names you mention (like TP_MANUAL_ENTRY) are the names of the items in the enum(eration). You could easily create your own lookup for gettg the "name" from the code number. Note that the NET-Hook API does not support manipulating every toolpath operation type. That may (or may not) affect you after you have loaded those operations. It depends on what you are trying to do. You want to be able to have your add-in run when the user right clicks in Mastercam's Toolpath Manager? Not possible. You can start an add-in via an icon clicked in the UI and/or if it's mapped been to a keystroke.
  8. Roger Martin from CNC Software

    VBS to NEThook question

    A NET-Hook can call/execute a VB Script. The script could then write out this “count” to some known location (file) that the NET-Hook add-in would read The NET-Hook equivalent to obtain this information would be the GetOpGroupDataInExternalFile method. ''' <summary> Gets data from an external Mastercam part file. </summary> ''' ''' <remarks> NOTE! A Mill/Router type Machine Group MUST exist in the ''' *active* file (not the file being interrogated) in order ''' for GetOpGroupDataInExternalFile to return any data. </remarks> ''' ''' <param name="filename"> Full path name of the file to interrogate. </param> ''' ''' <returns> A list of the operation names. </returns> Public Function GetData(ByVal filename As String) As List(Of String) Dim opNames = New List(Of String)() If File.Exists(filename) Then ' These parameter values must be pre-initialized as empty. ' They are filled in by GetOpGroupDataInExternalFile Dim grpData = New Mastercam.Support.Types.ExternalGroupsFileData() {} Dim opData = New Mastercam.Support.Types.ExternalOpsFileData() {} Dim result = SearchManager.GetOpGroupDataInExternalFile(filename, grpData, opData) If result Then For Each op As Mastercam.Support.Types.ExternalOpsFileData In opData ' Note that if the "name" has not been altered by the user, ' the operation has no name assigned to it and will be empty! opNames.Add(op.Name) Next End If End If Return opNames End Function
  9. Roger Martin from CNC Software

    Chaining multiple lines & or arcs in c-hook

    Please always tell us what version of Mastercam! It appears you’re are wanting to create a Chain “directly” from entities, without using any “select a chains” functionality? If so, look at this code snippet. /// <summary> Construct a Chain from the supplied list of entities. </summary> /// <param name="entities"> The (in order!) line and/or arc entities. </param> /// <returns> The new chain if successful, else null. </returns> CHAIN *CreateChain (std::vector<ent> &entities) { CHAIN *chain; short err = alloc_chain (&chain, FALSE /* partial*/); bool result = (err == 0 && chain != nullptr); if (result) { CHAIN_ENT *last_chain_ent = nullptr; for (auto &entity : entities) { short errCode = add_curve_to_chain (&entity, 0, TRUE, 0, chain, &last_chain_ent); if (errCode != CHAIN_OK) // bail out ! { result = false; break; } } } return (result ? chain : nullptr); }
  10. This is not possible to do "from the outside" using an add-in.
  11. Roger Martin from CNC Software

    Can NETHook get an operation's cycle time?

    The GetMinimumZ() and GetMaximumZ() methods call the API's GetMaxAndMinZ method to find the Z data. And unfortunately, I see that the GetMaxAndMinZ method was broken until Mastercam 2019.
  12. Roger Martin from CNC Software

    Can NETHook get an operation's cycle time?

    Not with doing the calculation yourself. There are not separate incremental and absolute values stored in the operation's data.
  13. Roger Martin from CNC Software

    Can NETHook get an operation's cycle time?

    The value you get from a specific property in the LinkingParams of an operation, is just the "value". It is not an incremental/absolute value, it's just a "value" The true/false setting of the DepthIncremental (in the case of Depth) tells the system how to "look at" the (Depth) value. If "linking.DepthIncremental" = True Then it is incremental "from somewhere else", such as Top Of Stock. Experiment with a simple 2D-Contour path, changing just the DepthIncremental and see what the Depth value is in each case.
  14. Roger Martin from CNC Software

    wireframe geometry going to wrong level

    Sounds like the Entity Attributes Manager. Open the Attributes Manager and check the active settings. You don’t say which version of Mastercam you’re using, so how that’s done can differ. You can also get to those setting in Mastercam Configuration. Configuration – CAD (page). In the lower-right of this page are 'Entity Attribute Manager' settings.
  15. Roger Martin from CNC Software

    Can NETHook get an operation's cycle time?

    In the NET-Hook API for Mastercam 2020 there these CalcCycleTime methods - Operation.CalcCycleTime OperationsManager.CalcCycleTime

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