How to Modify the Setting of Gcode in Slicer?

In the world of 3D printing and building, it is hard to discard the power of G-codes. Its complexity can be a bit challenging at times but it can also be very rewarding!

However, do you know how to modify the setting of Gcode in Slicer?

To change the settings in Slicer, you need to open your preferred Slicer software (Prusa/Cura) and click on printer settings. Then, choose the Custom G-code option. After that, you will be able to change the start or end G-Code.

However, this is only a snippet of the vast possibilities that you can achieve through G-Codes! Let’s dig deeper into the actual strength and the proper guide to optimize your slicing technique.

What is G-Code and How You Can Start Working with it?

G-codes are, if you don’t already know, basically command lines that can help you to control your printer. These codes go hand-in-hand with M-code which is very similar as well. 

These codes are basically a bunch of instructions that can help you slice your 3D models. In 3D printing, G-codes are created for one specific reason and that is to “slice” the objects before starting the printing process.

There are two main G-codes to use regularly. Start G-code and End G-code.

Start G-code, as the name suggests, initiates before you start the printing or slicing process. You send it to the printer to home the axes (you will learn about this a bit in the table below) and reset the extruder.

On the other hand, the End G-code is placed so that you can control the printer properly to maintain the temperature or lower the platform. Many more instructions and codes are utilized in both Start and End G-codes.

If you are a 3D printing enthusiast looking to start your journey, you first need a good sublimation printer. After you get that, then you can dive deeper into the G-Codes and other nitty-gritty details!

Otherwise, you will find yourself lost in the ocean of options out there. Now, if you are ready, we can dive into how G-code can be modified in slicer software.

But first, get familiarized with these common G-codes so that you can easily understand what these codes actually do-

Command UseExample
G1A linear movement in the working surface. Or, set the feed rate at which motors move in mm/ minute.G1 A4; Lift the A axis 4mm
G1 F1000; Set speed to 1000mm per minute
G4Dwell. Basically a millisecond pause to the sequence.G4 P2000
G10Retract filament according to settings of M207G10 P1 X100 Y200 Z50; Set work offset P1
G20Set the unit of measurement to inches.G20; Set units to inches
G21Set the unit of measurement to millimeters.G21; Set units to millimeters
G28Home all axesG28; Home all axes (X, Y, Z)
G90Absolute positioning. Logical coordinate spaces are considered.G90; Set to absolute positioning
G91Use relative coordinates.G91; Set to incremental positioning
G92Customized coordinates.

How to Modify Different Settings of G-Code in Slicer?

Modifying the G-code settings in any slicer software requires a bit of patience and prior knowledge. As mentioned before, all the G-codes define certain actions or tasks for the printer. 

So, without knowing the G-codes first, you will be blindly adding or editing them in the slicer software. That’s why we emphasize understanding at least the basic codes first and then continuing through the modifications.

Here, we used the all-powerful Ender 3 Pro and Ultimaker Cura for the whole process. However, this can be easily replicated with some minor changes in different printers and software as well. So, you don’t have to worry about it too much!

Let’s get to know how you can edit and modify the settings or command lines in Slicer-

Step 1: Open the Slicer application and open a project. If you are adding your printer for the first time, then you will be able to copy the Start and End G-code from here.

Slicer application

Step 2: Now, you can copy the G-codes and paste them into your preferred IDE or simple Notepad software.


Step 3: Let’s start with the very first command line. We can use G90 to set absolute positioning.

G90; Absolute positioning

Step 4: Use command M117 to show a prompt to the Ender 3 Pro’s LCD screen. This is just to show what you are trying to do in the slicer.

M117 3D H2Use3DPrinter; Prints the string to the LCD screen

Step 5: Use command G4 to pause the script for five seconds.

G4 P5000; Wait for 5 seconds

Step 6: Use the command M117 to display a similar message again, and G4 to pause the script for 2 seconds so that you can read it.

M117 Heating bed; Prints the string to the LCD screen

G4 P2000; Wait for 2 second

Step 7:  Use command M190 to make the heat bed temperature rise up to 70 degrees Celsius. 

M190 S60; Set the bed temperature to 60C and wait until it hits that temperature

Step 8: Home all the printer axes with command G28.

G28; Home all axis

Step 9: Now, you can set the movement speed of your bed as you want. Use the command G1 to and select a speed like 1000 mm/minute. It’s best to start the process slowly.

G1 F1000; Set Feedrate (tool movement) to 1000 mm/min

Step 10: Lift the Y axis 10mm using command G1 so that the nozzle is clear of the print bed. (You can customize it depending on your needs)

G1 Y10; Lift Y-Axis 10mm

Step 11: Use the G1 command to move the nozzle to a set X and Z position. 

G1 X30 Y45; Move to position 1

Step 12: You can add a print instruction stating what you plan to do.

M117 Level the bed 

Step 14: Finally, you can use either M0 or G4 command to user input or dwell time. 

M0; Stop, waiting for the response from the user

Please note that the M0 command is not supported with every 3D printer. In such cases, use the G4 command as a long pause. For example:

G4 P30000 [for 30s delay]

So your modified Start G-code should look something like this-

modified G-code

Step 15: Now, copy the Start G-code and paste it into the Cura slicer settings.

Cura slicer settings

Step 16: You can repeat the same process for the End G-code as well with some minor adjustments.

So, you are now all set to utilize the G-codes to modify and edit any instructions for your slicer software. However, be careful to check your 3D printer slicing issues beforehand. Otherwise, you will not be happy with the results!

Bonus: You can also check out this short tutorial on how to access and edit your G-codes-

What Can You Gain From Modifying G-code Settings in Slicer?

There are actually too many things you can achieve from modifying G-code settings. From controlling the feed rate to adjusting the bed temperature, you can optimize the whole slicing process through G-codes.

Here’s how you can be benefitted from G-code-


You can control the temperature of the nozzle, level bed, and more from your G-code as shown in the previous section. Just change the temperature degrees to the one you need and it’s done!


Similar to temperature, speed is another important aspect that can be controlled with your G-code modifications. You can change the RPM of the feed rate just by changing the digits. 

However, always make sure to print at a slower rate as it significantly improves the quality of your 3D objects.

Axis Adjustment

If your 3D object is not in the right plane or requires some movement in any axis, you can achieve that from your G-code. State what the coordinates will be and the printer will understand what you need.

Plus, you can also set the coordinates to absolute or relative depending on your requirements.

Layer Height

The z-axis acts as the layer height on the slicer software. The swiftness of your slicing and printing can be achieved through a larger layer height. On the other hand, you will require more time to print if you choose small layer heights with a better dimension resolution.

Frequently Asked Questions (FAQs):

Can I add Custom G-code to My Prints?

Yes, some slicers like Pursa or Cura allow you to insert custom Gcode scripts in the Start G-code or End G-code. This can be helpful for filament purging routines or activating specific printer features. 

What are Slicer Settings?

Slicer settings can be many things, starting from printing, temperature control layer customizations, and so on. You can browse and edit most of your Slicer settings from the home tab. The settings let you customize everything to your needs.

Is There a Way to Modify Slicer Settings for Multiple Prints at Once?

Yes, most of the advanced slicers let you modify and save different profile settings for multiple printers. This way, you can quickly choose among different settings and reduce the friction to start printing.


So, now you know the full process of how to modify the settings of G-code in the slicer application. While different applications have different settings, G-code is universal. 

With some proper instructions and guidance, you can add, edit, and modify your G-codes easily.

Hopefully, you will be able to control the settings of your G-code accurately now!

Leave a Comment