Mick George

CNC Software
  • Content count

    613
  • Joined

  • Last visited

  • Days Won

    1

Mick George last won the day on March 25

Mick George had the most liked content!

Community Reputation

48 Excellent

1 Follower

About Mick George

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male

Recent Profile Visitors

1,295 profile views
  1. Mick George

    Active tool list help

    You can search the XML file that is created by the tool list call, from the setup sheet dialog hold the CTRL button and left mouse click the green check button to have Mastercam generate a full XML file. The file will be located in your C:\Users\Public\Documents\Shared Mastercam 2022\common\reports\XML folder and you can search the tags. You can also take a look at the report help file and see the tag section.
  2. Mick George

    NET-Hooks: C# and VB.NET project examples

    Thomas, Make sure to select the drop down to filter out the examples list. FWIW many of the 2017-2020 examples will works just fine in 2021+ other than the ToolNetApi examples which have a couple namespace breaking changes.
  3. Mick George

    NET-Hooks: C# and VB.NET project examples

    Ah yea that link is no longer valid, I did report the post to update the link as I am unable to edit it. https://my.mastercam.com/Communities/3rd-Party-Developers/NET-Hook-Downloads is the correct link. Thanks for catching that. I'll see what I can do with more tool examples.
  4. We do have a backlog item for a C++/CLI template so that is coming.
  5. There is a tutorial from 2018 at https://my.mastercam.com/Learning/Tutorials/Mastercam that walks you through using setup sheets if you haven't seen it. There are also a few threads for setup sheets in our https://kb.mastercam.com/Knowledgebase.aspx just search for 'setup sheets'
  6. A presentation from a couple years ago some of you might find helpful. Mastercam Setup Sheet Customization Using Our .Net API
  7. Mick George

    Activereports stock image issue

    Did you ever get an answer to this? If not, if you open the image in an image viewer is it actually that small? The image control used in the active reports has a size mode property, by default it is set to Zoom, you could try the Stretch or Clip setting to see if that gives you the view you are looking for.
  8. Mick George

    Level Report

    I'd contact QC per Peters' recommendation.
  9. Not sure if you are aware or you are doing this for a specific need there are file open and file save dialogs that are simple to implement.
  10. This might help but it is old. '//////////////////////////////////////////////////////////////////////////////// '// '// Author: Mick George [email protected] '// Date: 11/11/2003 06:34 PM '// File Name: NC for each OP.vbs '// '// Description: '// '// Comments: I should be home playing threewave... '// '//////////////////////////////////////////////////////////////////////////////// ' -- Start Script Call Main() ' //////////////////// ' Sub Declaration ' //////////////////// Sub Main() Dim intOpsCount, intThisOp ' -- Pass a null string to tell MC we want this files ops intOpsCount = GetOperationCount(vbNullString) If intOpsCount > 0 Then For intThisOp = 1 To intOpsCount If Not RunPost(intThisOp, GetOperationNameFromID(vbNullString, intThisOp)) Then ShowString "Failed to create NC for operation " & intThisOp End If Next Else ShowString "Nothing to post" End If End Sub Another for groups, again might be helpful '//////////////////////////////////////////////////////////////////////////////// '// '// Author: Mick George [email protected] '// Date: 16/03/2004 01:35 PM '// File Name: OperationGroups.vbs '// '// Description: Demo script that highlights various group functions '// '// Comments: SP2 req + March Main 2004 mcamvb CHook '// '//////////////////////////////////////////////////////////////////////////////// '///////////////// My Constants ///////////////// Const GROUP_ALL = -1 Const GROUP_GEOMETRY = 0 Const GROUP_OPERATIONS = 1 Const SYSTEM_GROUP = 2 Const SYSTEM_RESULT = 3 Const GROUP_TOOLPATH = 4 ' -- Start Script Call Main() ' //////////////////// ' Sub Declaration ' //////////////////// Sub Main() Dim idx, intGroup ' -- Get all groups intGroup = GetGroupCount ' -- Do we have at least one? If intGroup = 0 Then ShowString "No operation groups" Exit Sub Else ShowString intGroup & " operation groups found" End If If askYesNo("List all group types?") = mcMSG_YES Then ' -- Iterate all groups For idx = 1 To intGroup Select Case GetGroupTypeFromNumber(idx) Case GROUP_ALL: ShowString "Group #" & idx & " is of type group all" Case GROUP_GEOMETRY: ShowString "Group #" & idx & " is of type geometry group" Case GROUP_OPERATIONS: ShowString "Group #" & idx & " is of type operation group" Case SYSTEM_GROUP: ShowString "Group #" & idx & " is of type system group" Case SYSTEM_RESULT: ShowString "Group #" & idx & " is of type system result" Case GROUP_TOOLPATH: ShowString "Group #" & idx & " is of type group toolpath" End Select Next End If ' -- Iterate all groups For idx = 1 To intGroup ' -- Echo their name ShowString GetGroupNameFromNumber(idx) ' -- Rename groups If Not SetGroupNameFromNumber(idx, "My New Operation Group #" & idx) Then ShowString "Could not set operation group name for " & GetGroupNameFromNumber(idx) End If Next ' -- Create a temp group If CreateGroupFromName("Test Group") Then ' -- Delete it? If askYesNo("Delete new test group?") = mcMSG_YES Then If DeleteGroupFromName("Test Group") Then ShowString "Group Deleted" End If End If Else ShowString "Could not create Test Group but it was created??" End If intGroup = GetGroupCount If intGroup = 0 Then ShowString "No operation groups" Exit Sub Else If intGroup = 1 Then ' -- We can't remove the only group ShowString "One group remains" Exit Sub End If ShowString intGroup & " operation groups found" End If If askYesNo("Delete last operation group by number?") = mcMSG_YES Then ' -- Delete the last operation group DeleteGroupFromNumber intGroup End If intGroup = GetGroupCount If intGroup = 0 Then ShowString "No operation groups" Exit Sub Else ShowString intGroup & " operation groups found" End If End Sub And one more '//////////////////////////////////////////////////////////////////////////////// '// '// Author: Mick George [email protected] '// Date: 15/03/2004 09:30 AM '// File Name: SetEveryOtherOpForPostingOff.vbs '// '// Description: Iterate all operations in current drawing, set every other '// operation off for posting. '// '// Comments: Requires March Maintenance release '// '//////////////////////////////////////////////////////////////////////////////// ' -- Start Script Call Main() ' //////////////////// ' Sub Declaration ' //////////////////// Sub Main() Dim intOpCount, idx, intCount ' -- How many operations do we have? intOpCount = GetOperationCount(vbNullString) ' -- Test If intOpCount = 0 Then ShowString "No operations in current drawing": Exit Sub ' -- Initialize intCount = 0 ' -- Let's see how many operations are off before we do anything For idx = 1 To intOpCount If GetOperationPostingFromID(vbNullString, idx) Then intCount = intCount + 1 End If Next ' -- Test If intCount = 0 Then ShowString "All operations are set to post off" Else ShowString intCount & " operations are currently set to posted on, we will now set all of them post off" End If ' -- Turn off all ops first regardless if they are on or not For idx = 1 To intOpCount If SetOperationSelectedFromID(vbNullString, idx, False) Then If Not SetOperationPostingFromID(vbNullString, idx, False) Then ShowString "Could not turn off operation # " & idx End If End If Next ' -- Initialize intCount = 0 ' -- All operations should now be off, lets do a quick check For idx = 1 To intOpCount If GetOperationPostingFromID(vbNullString, idx) Then intCount = intCount + 1 End If Next If intCount = 0 Then ShowString "All operations are set to post off after call to SetOperationPostingFromID(FALSE)" Else ShowString intCount & " operations are posted on!!??" End If intCount = 0 ' -- Select every other operation For idx = 1 To intOpCount Step 2 If SetOperationSelectedFromID(vbNullString, idx, True) Then If SetOperationPostingFromID(vbNullString, idx, True) Then ' -- Success intCount = intCount + 1 Else ShowString "Could not set operation # " & idx & " off" End If End If Next If intCount > 0 Then ShowString intCount & " operations are set to post off from " & intOpCount & " total operations" End If ' -- Post only what is not ghosted 'Call RunPostAll(GetPathOfThisScript, True) End Sub
  11. Check your \Users\Public\Documents\shared mastercam_version\VB folder as I know we shipped several script examples and I know there was a couple post examples.
  12. The C# WinForms project template has been updated to v2.4 to address an issue with a broken namespace.
  13. Here is a snippet of code that will create a new holder, assign a stp file to the geometry and add it to the the tool db /// <summary> Adds new holder to database. </summary> /// /// <returns> A TlHolder. </returns> private TlHolder AddNewHolderToDatabase() { // build path to tools var folder = Path.Combine(SettingsManager.SharedDirectory, "mill\\Tools"); // tool db const string library = "micks.tooldb"; // build path to db var toolDb = Path.Combine(folder, library); // part file for holder geometry const string file = "83-PORTA.stp"; // build path to stp file var geometryFile = Path.Combine(folder, file); if (!File.Exists(geometryFile)) { DialogManager.Exception(new MastercamException($"File not found {geometryFile}")); return null; } // If the library does not exist, it will be created. var tls = new ToolLibrarySystem(); try { // verify it opened successfullly var success = tls.OpenLibrary(toolDb, true); if (!success) { DialogManager.Exception(new MastercamException($"Failed to open {toolDb}")); return null; } var holder = new TlHolder { Name = "micks holder with geometry", Description = "created via toolnetapi", // assign the path GeometryFile = geometryFile }; // import the actual file success = TlGeometryImportExport.ImportProfileFromFile(holder, geometryFile); if (!success) { DialogManager.Exception(new MastercamException($"Failed to Import Profile From File {geometryFile}")); return null; } // add to tool library success = tls.Add(holder); if (success) { return holder; } DialogManager.Exception(new MastercamException($"Failed to add holder {holder.Name}")); return null; } catch (Exception e) { DialogManager.Exception(new MastercamException(e.Message, e.InnerException)); } finally { // clean up if (tls.IsOpen()) { tls.CloseLibrary(); } } return null; }
  14. Please email our sdk support mailbox with the above information including your version of Mastercam so we can get it into our system and rule out a potential issue with the API
  15. ATP assumes all geometry on a given level to be at the same Z so it selects all the geometry and uses the first item in the list to set the depth. There is a feature request to change this behavior and allow multiple depths of the "same" geometry on a level but unfortunately, for now, you will need to put specific geometry/depth combinations on unique levels.

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