exporting gcode in mmg file

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: exporting gcode in mmg file

Post by GeneFC »

It seems most of those should be in the preamble. Just delete them from the postprocessor code.

The M and T codes are added by the Path WB. You may need to catch those and remove one by one.

I do not use those codes either, and here is an example of how I removed them.

Code: Select all

  # Check for Tool Change:
            if command == 'M6':
                # if OUTPUT_COMMENTS:
                #     out += linenumber() + "(begin toolchange)\n"
                # for line in TOOL_CHANGE.splitlines(True):
                #     out += linenumber() + line
                outstring.pop(0)  # remove the command
                pass
I did not actually remove anything, but just added the comment symbol, #, to the front of the lines I did not want.

It should go without saying that you need a custom postprocessor that does not get changed when you install a new version of FreeCAD. That custom postprocessor can go in the macro folder in the same area as your configuration files.

Gene
Post Reply