<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Converting Slic3r Gcode to suit EMC</title>
        <description> Hi

I am keen to try Slic3r. I use EMC as control software so I us A instead of E for the extruder. I can use global edit in an editor to make changes but that can be time consuming. My experience of Linux is limited, can any one point me to a quicker way? Ideally a means of converting a number of files at once.</description>
        <link>https://reprap.org/forum/read.php?263,113126,113126#msg-113126</link>
        <lastBuildDate>Fri, 04 Sep 2026 19:40:59 -0400</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,136112#msg-136112</guid>
            <title>Re: Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,136112#msg-136112</link>
            <description><![CDATA[ Greetings, gentlemen. I constructed a cnc and I have 2 drivers, and Linux cnc match. mastercamX5'm learning to machine parts. This program generates a. nc incompatible with asking linuxCNC files. ngc. could explain foolproof as applied, the filter system? I do not understand the amendment.<br />
<br />
Greetings from Argentina<br />
ezequiel]]></description>
            <dc:creator>ezequiel</dc:creator>
            <category>Slic3r</category>
            <pubDate>Mon, 04 Jun 2012 13:53:26 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,113501#msg-113501</guid>
            <title>Re: Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,113501#msg-113501</link>
            <description><![CDATA[ Many thanks again Frédéric. That worked like a charm.]]></description>
            <dc:creator>emt</dc:creator>
            <category>Slic3r</category>
            <pubDate>Thu, 12 Jan 2012 10:31:53 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,113330#msg-113330</guid>
            <title>Re: Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,113330#msg-113330</link>
            <description><![CDATA[ Something like:<br />
<br />
<pre class="bbcode">
#!/usr/bin/env python
# gcode2ngc.py

import sys


# First line
print "%"

f = file(sys.argv[1])
for line in f:

    # Change extruder axis name
    line = line.replace(" E", " A")

    # S -&gt; P
    line = line.replace(" S", " P")

    # Comment M82 code
    line = line.replace("M82", ";M82")

    print line.strip()

# Last line
print "%"</pre>
<br />
should work.]]></description>
            <dc:creator>fma</dc:creator>
            <category>Slic3r</category>
            <pubDate>Wed, 11 Jan 2012 13:11:01 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,113303#msg-113303</guid>
            <title>Re: Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,113303#msg-113303</link>
            <description><![CDATA[ Frédéric<br />
<br />
Many thanks. That taught me a bit more about EMC2. How would you modify gcode2ngc.py to also replace all S with P?<br />
<br />
I tried to guess the solution and ended up with duplicate lines.<br />
<br />
Also the other line that causes me a syntax error in EMC gcode is the M82 generated by slic3r. At the moment I am editing the Gcode file and deleting it. How do you deal with that?]]></description>
            <dc:creator>emt</dc:creator>
            <category>Slic3r</category>
            <pubDate>Wed, 11 Jan 2012 10:50:55 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,113135#msg-113135</guid>
            <title>Re: Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,113135#msg-113135</link>
            <description><![CDATA[ A better way is to let Slic3r use E as extruder - it will allow you to load gcode file in other tools (viewers) - and to write a filter. It will also convert from .gcode extension to .ngc. I use this filter:<br />
<br />
<pre class="bbcode">
#!/usr/bin/env python
# gcode2ngc.py

import sys


# First line
print "%"

f = file(sys.argv[1])
for line in f:
    print line.replace(" E", " U").strip()

# Last line
print "%"</pre>
<br />
To enable this filter, add the following code in the [FILTER] section of the .ini file:<br />
<br />
<pre class="bbcode">
PROGRAM_EXTENSION = .gcode Slicers Gcode file
gcode = /home/fma/emc2/configs/reprap/nc_files/gcode2ngc.py</pre>
<br />
put the python script in the nc_files directory (or any other directory, as long as you tell EMC2 where it is, through PROGRAM_PREFIX var in the [DISPLAY] section.]]></description>
            <dc:creator>fma</dc:creator>
            <category>Slic3r</category>
            <pubDate>Tue, 10 Jan 2012 13:01:25 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,113134#msg-113134</guid>
            <title>Re: Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,113134#msg-113134</link>
            <description><![CDATA[ Many thanks.<br />
<br />
I did miss that. Is there an easy way to change the g code file suffix?]]></description>
            <dc:creator>emt</dc:creator>
            <category>Slic3r</category>
            <pubDate>Tue, 10 Jan 2012 12:55:34 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,113127#msg-113127</guid>
            <title>Re: Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,113127#msg-113127</link>
            <description><![CDATA[ You probably missed the "Extrusion Axis" option in Slic3r. Just change E to A there.]]></description>
            <dc:creator>Sound</dc:creator>
            <category>Slic3r</category>
            <pubDate>Tue, 10 Jan 2012 12:29:03 -0500</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?263,113126,113126#msg-113126</guid>
            <title>Converting Slic3r Gcode to suit EMC</title>
            <link>https://reprap.org/forum/read.php?263,113126,113126#msg-113126</link>
            <description><![CDATA[ Hi<br />
<br />
I am keen to try Slic3r. I use EMC as control software so I us A instead of E for the extruder. I can use global edit in an editor to make changes but that can be time consuming. My experience of Linux is limited, can any one point me to a quicker way? Ideally a means of converting a number of files at once.]]></description>
            <dc:creator>emt</dc:creator>
            <category>Slic3r</category>
            <pubDate>Tue, 10 Jan 2012 12:21:38 -0500</pubDate>
        </item>
    </channel>
</rss>
