Simplify3D Color change, filament change, pausing

Please Login to Comment

So there really is a lack of proper info out there on how to do that. So after much research, i think i got it.


Filament Color Change with S3D

First Choose which option you are interested on.

Option A
You want to display your current layers on your LCD.
You want to pause print, move hot end out of the way, and change filament then resume.

Option B
You want to pause print, move hot end out of the way, and change filament then resume.

Here is the code.

Option A
Go to Process Settings
Go to Scripts Tab
On the bottom box (post processing) enter

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 4, Z="}

Please note you must change the layer's number to the layer you want the color to change at!
You can repeat the third line as many times as needed, just update the layer number accordingly.
**Order of the above code matters. Enter it exactly. The third line assumes the previous two lines exist.

Option B
Go to Process Settings
Go to Scripts Tab
On the bottom box (post processing) enter

{REPLACE "; layer 4, Z = " "\nG1 X10 Y5\nM0\n; layer 4, Z = "}

Please note you must change the layer's number to the layer you want the color to change at!
You can repeat the third line as many times as needed, just update the layer number accordingly.

In simple terms, this is what it accomplishes.
First line adds M117 to the layers on the Gcode. It displays them on the LCD.
Second line eliminates some spaces so the whole data shows on a 20x4 display.
Third line is what looks for the M117 Layers label, enters a new line and inserts the coordinates to park, and pauses print.

UPDATE 1/14/17
Tip: (Thanks Plust)
Place a semicolon for the Option A 3th line or the line in Option B if you need a print without changing filament.

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
;{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 4, Z="}

UPDATE 12/9/2017
I have found out that for the Wanhao Duplicator i3 the pause command is M25 instead of M0. Update script code accordingly.

Also, some firmwares do not recognize M0 as pause, in that case, you may also try M600

First off, thanks for the background work in creating this much needed resource.

This may be obvious, but, I do not print using the LCD or SDCARD, I use a dedicated notebook running Win10 and the USB connection. Will this script work the same way when printing from a PC? I am running a FLSUN CUBE printer, updated to 32 bit with Marlin 2.x and use Simplify3D for slicing, and for the printing as well.

When using this scripting solution, does the location that the script moves the hot end to (x, y and z location) get saved by the printer, and as long as I only use the PC(in my case) to move the hot end for ease of access to catch flushed out previous colour filament using the Jog Control/Extrude button in Simplify3D, and all I would need to do is press Resume? Or would I need to use the Jog Controls to put the hotend back to where it was placed by the script before pressing Resume?

----Edit to add update

After reading through this thread and some others, and then looking at the GCODE file itself, it looks like when you use the M0 command to pause the print, it will stop processing the GCODE file at that point. Since the next pre-existing lines have the x, y and z co-ordinates in them, it must automatically return to where it needs to start again, regardless of any moves you make. The script you have provided includes M117 which is not used when you are using the PC to print via the USB. Given that, here is what I think I need to put in the post-processing box to pause my print job at layer 150 and 300 to change filament, are they correct? Do I need the new line (/n) in there?

{REPLACE " Z = " " Z="}
{REPLACE "\nLayer 150, Z=" "\nG1 X10 Y5\nM300\nM0\Layer 150, Z="}
{REPLACE "\nLayer 300, Z=" "\nG1 X10 Y5\nM300\nM0\nLayer 300, Z="}

---- Edit to add results

I ended up revising the script suggestion to just this when printing from Simplify3D on a PC via USB to printer..

{REPLACE " Z = " " Z="}
{REPLACE "; layer 150, Z=" "G1 X10 Y5\nM0\n; layer 150, Z="}
{REPLACE "; layer 300, Z=" "G1 X10 Y5\nM0\n; layer 300, Z="}

You don't really need the first line, provided you know for sure what the format of the ; layer line is in your GCODE file. I left it in purely to make it easier for me at the time. Since you are not using the LCD, the formatting of the line to allow it to fit is not really necessary. The inclusion of the semi-colons are there to avoid creating an issue with comments. The \n is a line feed(or next line) and puts each command on its own line. The script keeps the value of Z in the GCODE file, and inserts the new commands ahead of that number so that the final Z= get prepended to that value. After clicking resume, the machine goes to the location specified in the GCODE file, regardless of where you left the hotend. I would suggest that you locate a good location on your particular machine where you have the necessary room to change the filament. I would also suggest you not use the Jog Controls tab to move the filament or to flush out the old colour. I did that the first time, and as soon as the hotend was returned to the correct location to print, it retracted 100mm of filament, then proceeded to print. I saw it happen, so I hit pause, then manually pushed the 100mm of filament back in until I felt it hit the melted stuff. At the next change I did it manually. It is also quite easy to push the filament through manually to flush. I stick a sheet of paper under the nozzle to catch the mass.

Thanks a ton for this. I went with Option A and it worked great. A couple notes others may find useful:

First, I chose to add a beep when the print pauses via M300, so that the final line reads:

{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM300\nM0\nM117 Layer 4, Z="}

This lets me go into another room and do something else without risking forgetting about the print and leaving it on pause indefinitely.

Second, a tip for OctoPrint users. Like other people on this page, I needed to raise the extruder to make the switch on a particular print where I wanted a color change after only a couple layers. I found that I didn't need to make any further changes to the post-processing script, though: OctoPrint recognized that I was paused, allowed me to use the OctoPrint controls to raise the extruder, and then picked up right where it left off when I clicked on Resume. When I do this, I'm careful to lower Z by the exact same amount that I raised it before resuming.

I have no idea how much of this is specific to my setup (OctoPrint plus a Duplicator i3 running ADVi3++ firmware), so your mileage may vary. (I used M25 instead of M0 to pause because of the note here about the Duplicator i3.)

I tried option B with a Monoprice Maker Ultimate running Marlin 2.0.1 and it didn't work. I then used S3D to find the layer I wanted to change the color at, got the corresponding Z height for that layer in Preview Mode, saved the toolpaths to disk, and then edited the resulting gcode file in a text editor to add M600 immediately after that Z height occurred, and it worked. Once it got to that layer during printing, the printer paused, moved the head to the back corner of the build plate, unloaded the filament, then beeped at me to load the new color. I had to choose "Purge more" on the printer's screen a few times to get the new color to come out of the nozzle, then chose "Continue" and the printer immediately resumed printing from where it left off.

may sound dumb to do... but did you copy the code i have here into S3D or typed it? There's a SPACE before and after the = that must be there. It should work, all that option B does is search for the layer as its typed, and insert the new M0 line

I copied the code from your post above. Didn’t even change the layer number because it happened to be the same as the layer I wanted to change on.

feel free to export your FFF that contains the script that dont work for you and email it to me. 4gvtec@gmail.com
ill take a peek and see

Thank you very much!

Hi man,

what an amazing instruction.
Do you know or anyone else if the Anycubic i3 Mega-S or Chiron also support it with the stock firmware?

I would make a test to determine which command do you need to use. Either M0, M25 or M600....

Since i dont know the answer for your specific machines,
Use a calibration cube, insert one of the commands a few layers up and see which one forms with the stock firmware.

Thanks for your answer.

i choose to flash my i3 Mega and now M600 works perfectly.

still waiting for my chiron to arrive. Lets see how he will behave

{REPLACE "\n; layer 11, Z = " "; layer 11\nG28 Y0 X0\nM300\nM25\nG92 E0\nG28 Y0 X0\n; layer 11 "}

I use this code in my ender 3 and in the geeetech a10m and it works perfect for me
where it says layer 11, they have to put the corresponding layer, there are three layers in the code that must be changed with the same number to take effect, greetings

Hello STIG_, thank you, and thanks to whom helped to improve this help, very much for this instructions. Option B also worked great for my try!
I am glad I can now feel very confortable to use different filaments for my future prints, and not just limit myself to different layer heights.

I just tried option B and it works excellent! How or what is the best way to find out what layer you want to change filament on a taller print?

what i do is slice the model normally, then use the slider to move it up and down (the preview) to find out the spot i want to do this, most slicers show you the layer you are previewing

Works perfect, thanks!

Glad i was of some help!, Your welcome.

Thanks very much. :)

Glad i was of some help!, Your welcome.

If I want to have the extrusion multiplier go up at the same time, would it look like

{REPLACE "\nM117 Layer 14, Z=" "\nG1 X10 Y5\nM25\nM221 S103 D0\nM117 Layer 14, Z="}

or am I putting that where it doesn't belong?


Hello. Great post / thread. I have a Wanhao Duplicator I3 2.1 and am using S3D. I am used to Cura where I could pause the print, change filament color, and restart. Now with S3D, I pasted in the script as per below and all the print is doing is pausing correctly at the specified layer by moving to origin, but then restarts by going right back to where it stopped, presumably for the next layer, thus not allowing any parking of motor, changing of filament, etc. Not sure what I'm doing wrong. Any advice would be appreciated! Thanks in advance!

Here is what I pasted into the script for say changing out the filament color at layer 10 (tried a larger layer height too but same thing):

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 10, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 10, Z="}

Then your firmware doesnt handle the M0 command... in this case, change M0 for M600 and see if it works now.

Hi and thanks for responding! I'll try this. Also I found info on the Wanhao website per the link below that has a different script line (??). Here it is:
{REPLACE "\n; layer 19, Z = " "; layer 19\nG28 Y0 X0\nM300\nM25\nG92 E0\nG28 Y0 X0\n; layer 19 "}

(I'm guessing the above is for pausing at, for example, layer 19)

Here is the link, just scroll down to the info on S3D:

that is very good to know, i wasnt very familiar with the Wanhao firmware... glad i now know its M25 for Pausing with those.
Thanks for sharing!

One more thing. Tried twice over the weekend with a 3 hr print and it failed both times after prompting to change filament, then hitting "continue print" under the sdcard option on control box. I tried a small 1" x 1" x 1/2" high test print with the newly added "change filament" code per the line above and it worked fine, so I ventured into the larger print. Now it goes all the way and prompts to change filaments (actually just goes to 0,0 which I know means to change the filament as its the correct layer per the script line I set), then I change it, and then choose continue to proceed with rest of print. It goes thru all the motions fine but the only thing (and most important thing) is that it IS NOT EXTRUDING the filament. It did extrude fine with the test print but not with the larger print, which has a higher z value. ???? Not sure why this is, must be something in the slicer S3D causing no filament to come out. Any ideas???

Interesting... i have a few ideas... try again the test cube, maybe 1"x1"x1". I saw your previous code, and i would suggest making some edits to ensure the least amount of things are happening.
First, i would not use G28 X0Y0 on your code, this may end up triggering the end stops more likely. My code uses G1 (move) X &Y close to the front, but just shy of triggering the end stops, that way the machine doesnt reset its location.
Second, i saw you have G92 E0, which may end up messing up your extrusion, i am not 100% sure since now we know your machine doesnt run Marlin like mines.

Third, when i take the old filament out, and i push the new one in, i tend to push enough so i "prime" the nozzle, and as soon as i wipe the tip, i hit continue. It then tends to go back and continue printing.... which doesnt give it time to ooze, and get an air pocket. Always get seamless prints.

**Remember, that the Extruder motor will be on HOLD (locked) so you must be pressing the extruder arm to release the pressure so you can move the filament in and out. (u more likely knew this.)

Try just this and see:

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 9, Z=" "\nG1 X5 Y5\nM25\nM117 Layer 9, Z="}

Great info! I'll try this out tonite. Good suggestions. Here's the normal process I use. I setup the layer in the script where I want the print to pause, then save the gcode to the sd card (for now, getting Raspberry maybe for xmas). The print will go until the layer where its supposed to pause flawlessly. Instead of then "pulling" the filament out which had a tendency to break the filament inside the hot end, I have been doing a reverse extrude with the motor for months w/o issues using Cura for a filament switch. Then I normally hold the extruding lever down and "fish" the new filament into the hot end until it stops, then I use the extruder motor in normal direction to feed it in till it starts to come out. Extrude about maybe an inch or two, wipe off and immediately go to control box and choose sd card / continue.

No prob! Just trying to learn the script adder myself and came across your thread. The guys at S3D are using your thread for the filament changing reference so they must like your info! I'm coming over from Cura when another person posted something for that software in terms of a plug in. That works great but I recently purchased S3D for the features of better support customization and the most important thing that sold me was the tweaking option of process at different layer heights throughout the print (.1 for fine detail and .2 / .3mm for the stuff that doesn't much mattter). Only had my Di3 for a little over 1/2 year so still learning. I use Solidworks for my designs. Thanks again.

They do refence this? HA how cool... Just glad i can help others achieve better results

Yup. I guess your their man lol. Here is a snip from their email to me regarding this subject:

"This is a great post on changing filament mid-print: https://www.thingiverse.com/groups/simplify3d/topic:10525 Essentially, you need to replace the layer comment of the layer you want to stop at, which you can do with the REPLACE command in the post-processing toolbox in the Scripts tab. You can adjust the script in that link to have the print head go wherever you want for the change, and with no M84 to disable the motors, they will be locked when it is at that position. "

Is there a way to get this to raise the z height when you pause? I tend to pause it at a pretty low height for a lot of my prints, and sometimes the filament gets stuck to the heat block because its so low when i switch colors. Thanks for posting this though, helps me out a lot!

Thanks for the post, I'm new to 3D Prints as well as to S3D. Now in Theory if I want to change color to have a different color in the middle of my 111 layers object, then the code should be:

{REPLACE "; layer" "M37 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM37 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM37 Layer 4, Z="}
{REPLACE "; layer" "M74 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM74 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM74 Layer 4, Z="}

That way the second color would have to be changed in layer 37 and then again in layer 74 to the original color.
Am I correct?
Thanks for your help.

Hi everyone, I really wanted my Z to go up 20 mm and I tried to change it several times so I can not. Can any one help? I put something like that

{REPLACE "; layer" "M117 Layer"}
{REPLACE "Z =" "Z ="}
{REPLACE "\ nM117 Layer 593, Z =" "Z20 \ nM0 \ nM117 Layer 593, Z ="}

Can you check if this is correct?

Do you have to go up 20mm??
(also you have an error on the second line, take the space off Z =, should be Z=

Anyways, check my video description again. I just added one more option. if you have latest marlin, like 1.1.5+ i believe, you can use the advanced pause feature instead and that has an option to bring up the Z. I would use that instead of having to add a bunch more code manually. Reason it didnt work for you, its because you have to set relative and absolute positioning when doing that, otherwise, it wont work.

This is the code i use to pause. It raises my z up by 10. {REPLACE "\nM117 Layer 16, Z=" "\nG1 Z+10 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 16, Z="}

Kinda yes. But not sure why you have M37 in there. Should be something like this.

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 37, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 37, Z="}
{REPLACE "\nM117 Layer 74, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 74, Z="}

Got you, I misunderstood the original explanation.

No problem. Just happy to help others overcome the hoops I had to jump at one point or another

One more question. What if I want Z to be at Z10 so I can prime the nozzle?

Should it be?

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 37, Z=" "\nG1 X10 Y5 Z10\nM0\nM117 Layer 37, Z="}
{REPLACE "\nM117 Layer 74, Z=" "\nG1 X10 Y5 Z10\nM0\nM117 Layer 74, Z="}

I'm just trying to learn as much as I can here.

Kinda.... you want to be mindful of the place where you ask for the color change to take place. For example.. layer 37 its close to 7mm high considering a 0.20mm layer height. So, you can prime anyways.
With your code, its going to ask for the nozzle to move down (or up) to Z10, which may end up with the hot end hitting whatever you printing.
typically you will have plenty space to prime as long as your not changing colors in the first 8 layers.

I just finished printing a two color spinner for my kid, came out outstanding.
Thanks for your help.

Awesome!, glad it worked for you! Thumbs up

Sadly this method doesn´t work for my Prusa i3 mk2 since there is no mechanism allowing to change the filament by hand without any trouble. I've always done it over the menu. But if I use your code, I can't get in the menu, because if I click on the menu button, it automatically continues printing without letting me change filament.
So what I need is, that it moves the extruder away (as it does now) and pauses the print and I have to resume the print by the menu after changing the filament. Also a signal sound would be nice, if possible (my printer is able to do that).
How could I do that? Do you have any advice? It would be really nice! Thank you

You may need to do what I did and manually add "M600" to your color change locations in the GCODE for the MK2 (for information check out the bottom of this article: http://www.prusaprinters.org/easy-color-3d-printing-on-new-original-prusa-i3-1-75-mm-video/)

Thanks for your reply. So in this case, does it look like this?
{REPLACE "\nM117 M600 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 M600 Layer 4, Z="}

Or like this?

{M600 REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 4, Z="}

I quite don't understand how you meant it

Tested: This works perfectly ON PRUSA ORIGINAL I3 MK2S (I can't validate any other devices).

{REPLACE "; layer 2, Z = " "\nM600\n; layer 2, Z = "}
(where you change the layer number to suit your needs)

Thank you so much, you helped me out a lot!!

No problem, it gave me an excuse to learn something new :D

Ok, just tried it and must say: AWESOME. It just works like the color change of prusa!

I THINK (But need to test) that it would be something more like this:
{REPLACE "; layer 4, Z = " "\nG1 X10 Y5\nM600\n; layer 4, Z = "}
(where you change the layer number to suit your needs)

The Prusa Original i3 Mk2(s) does not recognize the M0 command as a pause in this dialog, so what I had previously done was saved my S3D project as GCODE and manually edited in the M600. M600 is Prusa's Marlin command for a filament change - which literally lifts the Z, moves it to the side, then beeps loudly at you until you begin following the prompts on the LCD to go through a filament change and purge.

If you are at a place where you can test that replace line, go for it - otherwise I'll try it out when I get home. Or, better yet, maybe someone like @STIG_ will jump in and be the educated voice of reason! :D


Is there a way of doing this per process rather than per layer? I'm not talking about using the advanced settings, still GCODE. Example: Say I have 2 objects on my print bed, but I want each of them to be a different color, your code calls for changing colors at a specified layer height, but is there a code for changing between processes (assuming I've assigned each model to it's own process)?

Lets assume you have two 20mm cubes, A is on the front and B is on the back of the built plate. Lets assume that Process1 for A. Leave that one alone.
On Process2 for B, you can insert on your starting script G1 X10 Y5 ( Y5 can be Y100 if you want head further back) and M0 on a new line. This will have the same effect.
remember that you cant have all the usual stuff on the starting script such as bed level, home axis etc, because it may crash into model A in the bed.
And also make sure the processes are sequential (of course since you asked for this)

So, this method calls out the known X/Y coords of the second model, correct? (Sorry, I'm just dipping my toes into the code end of this) Is there a way to call it out by process within S3D instead, or is the answer, "you have to print the processes separately"?

Maybe i can explain a bit better.
For what you asked, select in S3D the option where it uses Process1 to print model A, then goes to Process2 to print model B. You can choose this on the pop up once you hit slice.

The code G1 X10 Y5 is simply telling the hot end to move out of the way. The numbers justs tells it where to "park". You can enter whatever coordinate works for your case.
M0 is the actual command to pause the print.

Thanks so much for your advice - I tried M0 and that did nothing, so I found out that my machine (Prusa mk2s) uses Marlin which has the M600 code for changing filament. Unfortunately that also seems to do nothing, and I think here's why (and what I'm asking for now): So I am testing printing 4 process on one layer that I want to all be different colors. They are intertwined, so using the G1 options won't quite do it. In S3D I'm telling all of the processes to slice at once (and it's printing them separately and correctly so long as it runs all the way through with no pause/change), but when I put M600 in the starting script of the 2nd, 3rd, and 4th processes it does nothing (though connecting to the printer and sending M600 directly to the printer gives me the result I'm looking for). I'm just guessing here, but it appears that S3D is NOT looking at the individual process scripts once I have selected more than one and sliced it - but possibly creating a single starting and ending script based on the first and last models? Are there any additional thoughts about this, or suggestions on getting my intended result?

Edit: I have a work-around that (unfortunately) doens't have much to do with S3D. I saved the GCode and then manually edited it. S3D calls each process a "layer" and I was able to add a line for "M600" after each new "layer".

Does this code (or any of the others mentioned here) re-home the X and Y axis?
There is a good chance that the head will get moved, even a fraction, during a change over.
Also, how does one get to the machine settings to unfeed and refeed the filament? Or are you just pulling it out and pushing it in?

**Updated - The original method, doesnt disable the stepper motors for X and Y, so the extruder is not moving from its position. So once you click resume, it goes back where it was.
If you were to add a home X & Y will be pretty simple to this code. For example.
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 4, Z="}

On S3D u can either CTRL+P or click the icon on the right side. I have tested you can manually click feed E and it does, if you dont do it by hand. I have a bowden, so i feed it by hand softly until it primes. Should be same on direct drives.

Ok Thanks.
So the {REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 4, Z="} will home and return to the correct position to continue printing after the 'continue' signal?
As for using S3D for controls... i use my FFCP standalone. just insert the SD. select the file and away we go... No computer attached.

Yes it will resume normal.
All you gotta do is change the number 4 (twice on that code) to the layer # you want.

Can you tell me how is it possible to print every process 2layer heigt in diffrent collors? Is this code right? :
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 4, Z="}
What have i to change in the code that it change the filament after every process. An where have i to put the g gode? Start scripte side last box?

Hello M3d_factory.
First and foremost, im not trying to sound mean. But do you understand my original post? If you dont, perhaps read it a few more times. I am not trying to belittle, im trying to see if my next explanation will make sense to you.

If you do understand, here is the short version.
You can take that whole code i posted above and copy it into S3D as you would based on the first layer to make the color change.
You can then re-copy and re paste the same code under the previous one once again and then change the layer number to what you want to make the next color change. You can do this as many times as you wish.

When its all said and done, all this code does, it goes into your Gcode, and enters certain code right before the layer you want.

This works great!
I have add some code to the line so the printer beeps when I have to chance filament.
(M300 Sxxxx Sxxxx)
Sxxxx frequency in Hz
Pxxxx duration in milliseconds

Option A 3th line:
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM300 S1000 P1000\nM0\nM117 Layer 4, Z="}

Option B:
{REPLACE "; layer 4, Z = " "\nG1 X10 Y5\nM300 S1000 P1000\nM0\n; layer 4, Z = "}

Place a semicolon for the Option A 3th line or the line in Option B if you need a print without chancing filament.

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
;{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM300 S1000 P1000\nM0\nM117 Layer 4, Z="}

Excuses for my bad English ;)

Thanks for the semi colon idea, that will be very handy at just leaving code alone, and only activating it when needed. Thanks!.
Ill see about updating the OP

the easiest way to change colors / filament:
in: Advanced Tab / Layer Modifications
Stop printing at hight xx
(switch Heated Bed & Extruder ON) change colors / filament / ...
edit Process:
Start printing at hight xx (remove checkbox in "Stop ..")
see: http://www.thingiverse.com/make:284209

Funny Toilet Sign with background
by Nipsel

Thank you very much Nipsel. Glad see multiple options now.

Im sure "easiest" is a relative term. It all depends on where the user wants to edit many settings, or just add 1 line of code. But now that we have all this consolidated here, they can see what works best for them.

OR, if you have Repetier firmware, you can just edit the GCODE and place M600 at the layer you wish to do a color change.

Repetier lets you edit the Gcode, and shows layer your in (i like that!)
For repetier i insert the following code on the layer i wish to color change. Works great for me.

G1 E-3 F6000 ; retract filament
G1 X10 Y5 F6000; move hot end out of the way
M84 E; disengage E motor
@pause print
G1 X0 Y0 F6000; home X and Y axis
G1 E0 F6000; engage E motor

Thank you for the post, that's a very interesting subject. We also wanted to find official recommendations, a code for colour change in the middle of the print.

Did you try the S3D support team. What you have above looks good and should work. There is a easier way to do this by adding multiple processes and in Advanced setting set when to start and stop printing. Check out https://www.youtube.com/watch?v=H5a-7Pm081k&list=PLN2klu_fubRD4wQq-d067QjkdsNVUueD2&index=15

The multiple process will not work if you have a printer with a probe for bed levelling.
Also you have the heated extruder and bed (if you have a heated bed) up after you're filament change.
So I go for the STIG_ method.

Yes. I have done that multiple process method. It involves editing the end script and start script for both. Then it also matters the way it run your processes. So it introduces more steps that can risk not doing it right. Which drive me to finding a way to just enter one line of code on the layer I wanted and considering it done.
Thank you for your input. Have a great day

This is not working for me.
The Wanhao D6 ignores this code.
It just keeps on printing.

Iwonder if your firmware doesnt recognize M0..... Perhaps you can replace M0 with M600 to see if it does?

Wanhao printers ignore the m600 commands as well. lol
Maybe I must start with G91,G1,G90,M25

The following gcode commands are recognized by ReplicatorG – Sailfish as well as any slicers which use GPX to convert gcode to S3G/X3G.

Pause at ZPos:
M322 Zzzz.zz
Maybe that will work instead of M0

if you print from USB, can you start a test cube print, when its running then send a pause command and see what code the host sent to the printer? perhaps you can catch the command sent....