What's new
What's new

Hello Again

JaredMcLaughlin

Aluminum
Joined
May 23, 2008
Location
Pittsburgh, PA
Howdy. As you might notice if you cruise through my past posts, I have been a machinist for a while - somewhere around a decade. However, I collected some community college credits while making parts and decided to turn them in to a computer science degree.

Why? Ideally because I want to be involved in making machining better in some way. I'm at the point in my education where small projects are feasible, so I'm back here to find out what little bits of software might be useful.

My big focus is on the little things that impact CAM programming, but here's my little list of things I _might_ be able to pull off, and I feel are useful. I welcome your ideas and will tolerate your crude comments. 😁

1. Conversion utilities for gcode. I should be able to write something that takes gcode from one controller and spits it out for another. I think best case it would miss a ton of stuff, but would save the bulk of the effort if you had to do it. Might not be super useful, but is useful for my educational purposes.

2. Quick "bulk edit" for gcode. Need to scoot the tool plane around in z but hand coded some sections so just reposting isn't an option?

3. Tool library conversation between different software formats.

4. Tormach / linuxcnc MTConnect module. Unlikely to be relevant to folks here, but I can run linuxcnc without a machine to get experience writing software for the MTConnect protocol.

What slows you down that you think a plugin or simple external utility might help with? I've written to most of the CAM companies to see about getting neutered versions of their software to practice writing plugins.
 
Last edited:
Howdy. As you might notice if you cruise through my past posts, I have been a machinist for a while - somewhere around a decade. However, I collected some community college credits while making parts and decided to turn them in to a computer science degree.

Why? Ideally because I want to be involved in making machining better in some way. I'm at the point in my education where small projects are feasible, so I'm back here to find out what little bits of software might be useful.

My big focus is on the little things that impact CAM programming, but here's my little list of things I _might_ be able to pull off, and I feel are useful. I welcome your ideas and will tolerate your crude comments. ��

1. Conversion utilities for gcode. I should be able to write something that takes gcode from one controller and spits it out for another. I think best case it would miss a ton of stuff, but would save the bulk of the effort if you had to do it. Might not be super useful, but is useful for my educational purposes.

2. Quick "bulk edit" for gcode. Need to scoot the tool plane around in z but hand coded some sections so just reposting isn't an option?

3. Tool library conversation between different software formats.

4. Tormach / linuxcnc MTConnect module. Unlikely to be relevant to folks here, but I can run linuxcnc without a machine to get experience writing software for the MTConnect protocol.

What slows you down that you think a plugin or simple external utility might help with? I've written to most of the CAM companies to see about getting neutered versions of their software to practice writing plugins.

The plugin market for Mastercam is as hot as it ever has been. Using .NET and C you can write any kind of Mastercam plugin (CHook/NETHook as they are known). Why not download the Home Learning Edition of Mastercam and get cracking????

Very unlikely that any software company is willing to just "give" you a neutered version of software to dick around with. These packages are anywhere from $1K-70K+ and involve countless dev hours. Your best bet is getting .edu licenses if you work at a qualifying institution or are a student there. Mastercam education licensing is like $160/year now with their new promo. No other mid/high end CAM provider I know of is going to be willing to let you test drive unless you are a prospective customer.

Good luck
 
1. Conversion utilities for gcode. I should be able to write something that takes gcode from one controller and spits it out for another. I think best case it would miss a ton of stuff, but would save the bulk of the effort if you had to do it. Might not be super useful, but is useful for my educational purposes.

2. Quick "bulk edit" for gcode. Need to scoot the tool plane around in z but hand coded some sections so just reposting isn't an option?

3. Tool library conversation between different software formats.

4. Tormach / linuxcnc MTConnect module. Unlikely to be relevant to folks here, but I can run linuxcnc without a machine to get experience writing software for the MTConnect protocol.

What slows you down that you think a plugin or simple external utility might help with? I've written to most of the CAM companies to see about getting neutered versions of their software to practice writing plugins.

1) This is what post processors do. Generally, the toolpath is output in a APT file which is then parsed by the post processor and then G-code is outputted. I haven't found a good resources for APT file conventions, but its out their somewhere. Had to do some work on the Camworks APT file out put so it can translate the holder data to Camplete. Here is a doc that gives a nice overview.

Aside from that, you will need to write some code to parse the G-Code file, probably using regular expressions, and then convert it to whatever you want. Kind of like find and replace. Changing the geometry seems a bit cumbersome when the CAM software can just do it.

2. Again, find and replace type functions. I personally use Notepad++ for my G-code editor and you can customize it in a bunch of ways. I also use python for various things like adding this here or there. Here is my Notepad++ G-Code syntax highlighter. Will probably make another one for dark mode which just released recently.

3. Most tool libraries are SQL based. So, do a quick course on that if you can and start messing around. That combined with Python and use of CSV files, you can import export for specific systems. Finding out what a system wants for import is the hard part. I made a SQL script to rename all 2000 tools in my database using a standard I wrote as all the tools were originally named using fractional notation which I so very much loathe. Now they are all decimal notation and the name contains the majority of the information I need to make a selection at programming time.

Here are some example tool names from my standard:
Before
7/8 EM CRB 2FL 1-1/2 LOC
1/16 CRB 2FL BM 1/8 LOC
#60 CNC DRILL

After
0.8750 X 1.500L 2FL CRB EM
0.0625 X 0.125L 2FL CRB BM
0.0400 #60 135DEG 0.5L Cobalt DRL

Now, you can just sort by tool names instead of having to find the diameter column and sorting that. They all follow a similar convention where as before it seemed hacked together. Fun project. Script only takes 4 seconds to rename all the tools.


4) Not familiar with MTConnect.


Other things to think about was what another user mention which is APIs. Mastercam has chooks and whatnot, Solidworks has a full API for VBA, VB.NET, C#, and C++. Rhino has a full API for Ptyhon that's really good. Things of that sort.

If you're not a seasoned programmer, you may want to start with Python in general for scripting. I converted my SQL script I mentioned above into a Python executable so now anyone can run it easily. I've also used python to take a symbol scanner barcode output file which is in CSV and have it auto-populate our purchase request form that is excel based. This is more for general shop supplies that we have MSC barcodes for, which conveniently are also the MSC part number.

There are lots of things you can do. Just gotta explore a bit.
 
The plugin market for Mastercam is as hot as it ever has been. Using .NET and C you can write any kind of Mastercam plugin (CHook/NETHook as they are known). Why not download the Home Learning Edition of Mastercam and get cracking????

The Home Learning Edition idea is a good one. Thanks! Good to know that there's a market for Mastercam plugins. The more I think about it, the more this seems like a great suggestion.

Very unlikely that any software company is willing to just "give" you a neutered version of software to dick around with. These packages are anywhere from $1K-70K+ and involve countless dev hours. Your best bet is getting .edu licenses if you work at a qualifying institution or are a student there. Mastercam education licensing is like $160/year now with their new promo. No other mid/high end CAM provider I know of is going to be willing to let you test drive unless you are a prospective customer.

Isn't that essentially what the home learning edition is? You want users and plugin developers out there to draw other folks in, right?
 
1) This is what post processors do. Generally, the toolpath is output in a APT file which is then parsed by the post processor and then G-code is outputted. I haven't found a good resources for APT file conventions, but its out their somewhere. Had to do some work on the Camworks APT file out put so it can translate the holder data to Camplete. Here is a doc that gives a nice overview.

Do they all output APT first? I definitely remember seeing that in CamWorks.

Aside from that, you will need to write some code to parse the G-Code file, probably using regular expressions, and then convert it to whatever you want. Kind of like find and replace. Changing the geometry seems a bit cumbersome when the CAM software can just do it.

I have an EBNF grammar for ANTLR I'm going to try in ANTLR3. ANTLR4 doesn't have a C target, and my sense is that C is probably the right way to go with this, just because almost everything out there has a method of making calls to C libs. I think it generates an AST, which you could do more with that a find and replace.

3. Most tool libraries are SQL based. So, do a quick course on that if you can and start messing around. That combined with Python and use of CSV files, you can import export for specific systems. Finding out what a system wants for import is the hard part. I made a SQL script to rename all 2000 tools in my database using a standard I wrote as all the tools were originally named using fractional notation which I so very much loathe. Now they are all decimal notation and the name contains the majority of the information I need to make a selection at programming time.

Yeah, I noticed the MasterCAM one appears to be SQlite3 and Fusion 360 is json. Bulk renaming seems handy.

4) Not familiar with MTConnect.

It's a protocol for reporting machine state over a network - depending on what state the machine is programmed to share.
 
Many of the functions you talk about are already available in softwares such as Cimco Edit. If you are just looking to do projects to learn, giver, but if you are trying to monetize these projects you may want to evaluate your competition first.
 
Many of the functions you talk about are already available in softwares such as Cimco Edit. If you are just looking to do projects to learn, giver, but if you are trying to monetize these projects you may want to evaluate your competition first.

It's mostly to learn, but if I can do something useful in the process, then that's even better. I'll take a look at Cimco edit. Thanks.
 
The Home Learning Edition idea is a good one. Thanks! Good to know that there's a market for Mastercam plugins. The more I think about it, the more this seems like a great suggestion.



Isn't that essentially what the home learning edition is? You want users and plugin developers out there to draw other folks in, right?

I meant to clarify that Mastercam is likely the only one who will do it. The reasons are several....1) Mastercam has the highest market share of users 2)Mastercam has made a very concerted effort over the years to get their software into educational institutions, very much like Solidworks has done. I know because I am educational user of Mastercam and their EDU pricing structure is extremely cheap compared to industrial licenses. So they can afford to give 'free' licenses. They are very smart to have a Home Learning Edition and I wish other companies would have that so that people can actually evaluate CAM systems easier. You can't post code so it isn't like you can do much with it.

Over the years Mastecam seems to have been taking what used to be Chooks and just adding them into the software. Which is exactly what should have been done from the beginning. Things like Raster2Vector which should have just been a feature was a 'c-hook' that you had to run and execute up until like last release. Dumb! They even include it in the download but you have to execute it...like that to me is just lazy as hell.

Check out X+ for a good example of a robust c-hook

I don't believe there are many CAM softwares that have spent much effort getting seats of their software into education user's hands. Thus I think it unlikely or hard to get them to give you a copy for free/very cheap. Autodesk products are excepted from this. They do give their software for free to many users.
 
I meant to clarify that Mastercam is likely the only one who will do it. The reasons are several....1) Mastercam has the highest market share of users 2)Mastercam has made a very concerted effort over the years to get their software into educational institutions, very much like Solidworks has done. I know because I am educational user of Mastercam and their EDU pricing structure is extremely cheap compared to industrial licenses. So they can afford to give 'free' licenses. They are very smart to have a Home Learning Edition and I wish other companies would have that so that people can actually evaluate CAM systems easier. You can't post code so it isn't like you can do much with it.

Over the years Mastecam seems to have been taking what used to be Chooks and just adding them into the software. Which is exactly what should have been done from the beginning. Things like Raster2Vector which should have just been a feature was a 'c-hook' that you had to run and execute up until like last release. Dumb! They even include it in the download but you have to execute it...like that to me is just lazy as hell.

Check out X+ for a good example of a robust c-hook

I don't believe there are many CAM softwares that have spent much effort getting seats of their software into education user's hands. Thus I think it unlikely or hard to get them to give you a copy for free/very cheap. Autodesk products are excepted from this. They do give their software for free to many users.

Keep in mind chooks/nethooks cannot run in Mastercam HLE.
 








 
Back
Top