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:

Roger Martin from CNC Software

CNC Software
  • Posts

  • Joined

  • Last visited

  • Days Won


Roger Martin from CNC Software last won the day on February 25

Roger Martin from CNC Software had the most liked content!

Recent Profile Visitors

3,691 profile views

Roger Martin from CNC Software's Achievements


Newbie (1/14)

  • First Post Rare
  • Collaborator Rare
  • Posting Machine Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges



  1. chain_manager is in the MCMill.lib Is this library being included in the project? Project properties -> Linker -> Input page Or just add this #pragma after the #includes at the top of the .cpp where you are using chain_manager #pragma comment (lib, "MCMill.lib")
  2. What a well done (and beautiful) presentation. Thanks Aaron!
  3. Yes, chain_it(…) prompts the user to select the chains(s). I believe the mc_op_getChains(...) gets the chains from a Solid operation. You are passing in a DB ptr to a Solid and getting out the Chains (if any). The return is the number of chains found and returned via the [out] CHAIN **chains variable. See chain_all_selected(…) in Chain_CH.h You need to select the entities to be chained. Not difficult, but you want to have plan first. Are the entities all by themselves on a separate level? Or are they all a specific color? Or both? You could select the entities by level and/or color, and/or by some other property that is unique to those entities. I you would like working sample code of using this, email us SDK[at]Mastercam[dot]com with your company contact info.
  4. It is doubtful that mc_op_getChains(…) is what you need for this. What type of geometry is being chained – wireframe, or solids? What it the type of operation the chain is being assigned to?
  5. Yes, you can import from a .mcam file just like you do when using .mcam-operations files. I cannot tell what is causing the issue from just what I can see in the image. What version of Mastercam are you running? If you wish, send us your project to SDK[at]Mastercam[dot]com along with your company contact info, and we’ll take a look. When you ZIP up a Visual Studio project. Do not include the ‘x64’ folder and its subfolders. Just makes the ZIP huge with files we do not need, as Visual Studio will recreate them when you build the project.
  6. Step #1 -> First determine what functionality you need to accomplish. What exactly you want your add-in to do. List out all these “steps” it needs accomplish the desire end result. This step is skipped or rushed past all too often! "I want my add-in to automate creating toolpaths." Great! – You have the end goal. What individual steps are needed to get there? These are the important details. With that detailed information, now we can then determine which style of add-in you can use to do that. A C-Hook with C++ is always in the mix of “I can do it with this type of add-in”. But, if you can do want you need with the NET-Hook (C#) style add-in, that may be an easier route to take. If starting out learning C++ (and maybe C#), I would just start with C++. If you know C or C++, going then to C# is fairly easy.
  7. Mastercam has several types of add-ins. C-Hook style -> Done in C++ (or C++/CLI) NET-Hook style -> Done with C# or VB.NET C# Scripts -> Obviously done in C# (New in Mastercam 2022) The non C-Hook types do not provide as much functionality as a C-Hook type solution. Which to use? First determine what functionality you need to accomplish what you want your add-in to do. Does this require a C-Hook? If so, there is your answer. If it does not? If you know C++, doing C# for a .NET type add-in is not that difficult. If I can do want I need with a NET-Hook style add-in, that is my first choice. This from someone that spends the majority of their time programming C++.
  8. You first need to determine which of the above outputs are referencing a string selection. Then you could add another item to that string select table, post process a toolpath that you know should generate the errors and see what happens. (Make the new string added to the string select table something unique that will be obvious if you see it in the NC output if that new string is output.) Without the PST file my first guess would be to look at what is occurring for these items - *sg20code pwtcode pctype If the issue is not one of these, you will need to look at the others.
  9. An easy way to backup your Machine/Control/Post files. With a file opened with (at least one) operation using the Machine and its related files. File -> Zip2Go (on the backstage menu). Make sure the proper "Machine Group types" is checked. (Optional) You can also uncheck the "Config file" under File Options. Now "Create file" to generate the ZIP package. You will get more files in the output than you really need, but who cares? You have these important ones you need backed up.
  10. To access data in a Wire operation would require a (C++) C-Hook style Add-in.
  11. When you create a zipped package using Zip2Go you can specify (in the Save as type drop-down) if you want ZIP or Z2G for the output file. Either way what you end up with is a Zip archive. If you have Windows 10 you can just select a the .ZIP file. Windows will open this compressed file and show you the contents. Or from within Zip2Go itself, do File-Open, open the ZIP or Z2G file, then (on the Zip2Go top menu) do Command- Extract.
  12. I've sent Colin a copy of this newly created utility. We'll let him try it out to see if it's good, and if others want it, I can make it available after next week. *This is not an official CNC Software item, and thus receives no official support from CNC. What this utility does appears to be something similar to what user Elvincnc showed. [This utility works on code "lines", not a mass of run-on code as Elvincnc showed.] You can specify the Program Number character* to find/split on. You can specify the file extension for the output files. *If you use something like ":" it will work. But, that is not a valid character for a file name. It will fallback to using "O" instead of an invalid character in the output file names. This is a stand-alone program that does not require Mastercam. It remembers and recalls the last setting used each time it is run.
  13. Colin, I put together a utility that works as described. Then you threw me a curve with your file, as it has code lines before the initial 'O' program number. I need to rework the breakup logic. I'll hopefully have something for you tomorrow. % &F=//CNC_MEM/ &F=/MTB1/ &F=/MTB2/ &F=/SYSTEM/ &F=/USER/ &F=/USER/LIBRARY/ O9630(S.DATUM--FWB-4S4)
  14. You are just reading through a large file and finding a ‘O’ program numbers. Then wanting to save just the NC code between each ‘O’ and ‘M30’ (or ‘M99’) that denotes the end of the NC program, and write just those sections of NC code out to separate files using the 'O' program numbers for the output filenames? I may be missing something here? As that sounds like a simple utility to create. Can I see a example of the file you wish to breakup? sdk[at]Mastercam[dot]com

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