GPX gcode to x3g converter

by whpthomas, published

GPX gcode to x3g converter by whpthomas Apr 29, 2013



Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

90663Views 28734Downloads Found in 3D Printer Accessories


GPX is a post processing utility that converts GCode from 3D slicing software (like Slic3r and KISSlicer) into the x3g files used for standalone 3D printing on Makerbot Cupcake, ThingOMatic, and Replicator 1/2/2X printers. GPX output is compatible with both Makerbot and Sailfish firmware.

Version 1.4 (NOV 16, 2013)

If the machine definition is customised in gpx.ini and the same machine definition is specified on the command line, GPX now ignores the duplicate definition, preventing it from clobbering the custom definition. Some simple build statistics in verbose mode were also added.

Version 1.3 (SEP 26, 2013)

Support for Cura was added. Reprap gcode flavor now interprets M106/7 as M126/7 (blower fan) to support Cura. There is also a new Cura python plugin script.

Version 1.2 (AUG 24, 2013)

Added support for M133, M134, M135, M136 & M137 so gccode from Makerware converts without error. There is also a -g command line flag and gcode_flavor option to select Makerbot/ReplicatorG interpretation of M109.

GPX can be configured to perform convenient tasks like [email protected] scripting, changing filament diameters without re-slicing, ditto printing with different filament diameters and varying the print temperature for wood filament.

GPX is a fast and light weight program written in a structured programming style using ANSI C. GPX is precise and standards compliant in the x3g commands it outputs, and while it performs rigorous syntax and semantic error checking on the GCode input it interprets, GPX is very flexible and forgiving in the actual GCode it will accept.

GPX can be run from the command line, called by shell scripts or run as a post process. It has built-in support for 5D Cupcake, Thing-O-Matic and Replicator 1/2/2X printers. GPX can also load custom machine definitions if required. GPX configuration is very flexible, it can load a default configuration, be directed to load a custom configuration from the command line, or configured using a macro language embedded in the GCode header of the files it converts.


GPX is free open source software, the sources are available from github here: http://github.com/whpthomas/GPX

Comments/Feedback/Suggestions are all welcome on the GPX converter google group here: http://groups.google.com/forum/?fromgroups=#!forum/gpx-converter

More from 3D Printer Accessories

view more

All Apps

Upgrade this Thing with Thingiverse Apps

Tools and Utilities

Repair, slice, or enhance this Thing

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

I just downloaded this, but how do you use it?

There is a 2.0-Alpha of this program and Simplify3d uses it. Why isn't 2.0 up here? It is faster and has more control.

It looks like this release isn't updated anymore. You can get version 2.5.2 from https://github.com/markwal/GPX

Edit: Although, looking at your past comments you probably already know that soo... my bad.

2.5.2? WOW, not even s3d uses that version and they charge 150 for their software. Btw, this is one of the things I have a HUGE disagreement about with Simplify3d because they are using open sorurce software with their closed source, and for sale, software. Makes me really mad and I wonder if the GPL license allows that? Even if legal to do is it really ethical?

Thank you so much for the link.

it won't run. If I click the gpx application, it just flashes open a window for like a second then closes it. I tried opening it using the command prompt, but it says "gpx" does not exist... I am trying to convert a cura gcode

Here, this is as simple as you are ever going to get.


edit: That page is broken so here - https://github.com/markwal/GpxUi

Okay, I'm not very good with these sorts of things, so can someone explain to me how this works?
say I have a gcode created in craftware saved in my documents how do I get it so I can use it on my CTC 3d printer (which only accepts x3g)
Many thanks!

This converter unfortunately doesn´t support G2 and G3 commands.
if you need to convert gcode with this commands you must use replicatorG for export.

How the hell does one use gpx.exe to convert gcode to x3g file?
Whenever I click on it -- downloaded from this site -- all I get is a blink, and nothing happens.

Is there some peculiar way of using gpx.exe?

Its a command line tool. You need to run it from a command prompt.

If I try and do that, it says that "gpx" doesn't exist

Try following lisa4474's instructions in their comment below.

I did and still did not work!

Solved the problem by buying a $149 software - Simplify3D -- works like a charm.

Does Simplify3D create X3G files?

Yes, it does ... automatically!
Worth every penny!

doesn't compile, any ideas?

cc -c -w gpx.c -o gpx.o
cc -c -w gpx-main.c -o gpx-main.o
cc -lm getopt.o gpx.o gpx-main.o -o gpx
gpx.o: In function magnitude': gpx.c:(.text+0x1937): undefined reference tosqrt'
gpx.o: In function mm_to_steps': gpx.c:(.text+0x1dde): undefined reference toround'
gpx.c:(.text+0x1dfa): undefined reference to round' gpx.c:(.text+0x1e16): undefined reference toround'
gpx.c:(.text+0x1e45): undefined reference to round' gpx.c:(.text+0x1e7c): undefined reference toround'
gpx.o:gpx.c:(.text+0x1ea8): more undefined references to `round' follow
collect2: error: ld returned 1 exit status
make: *** [gpx] Error 1

In the MAKEFILE change line

$(CC) $(L_FLAGS) $(OBJECTS) -o gpx


$(CC) $(OBJECTS) $(L_FLAGS) -o gpx

downloaded and I get the M134 error from makerware gcode.
thought this was fixed in an earlier rev ?

seems GPX does not understand the heated plate for the Rep 2X machine

anyone have any thoughts ??

also, is there a listing of the Makerbot M(codes) such as the M134 which I believe is unique to the makerbot series.
it would be nice to have a 'COMPLETE' listing of these codes.

You might want to ask questions like these to the google group: https://groups.google.com/forum/#!forum/gpx-converter since there are more people checking there for questions.

Probably your machine type or gcode_flavor are not set to match the source of your gcode. When you post the question to the google group, it may be helpful to say what slicer you're using as well as command line and/or gpx.ini you're using.

Very very thanks Dr. Thomas !

Does anyone have the correct GPX configuration for a Flashforge Creator Pro?

I'm using the gpx conversion scripts to generate the x3g files on Slic3r and its not configuring correctly for this printer.
The problem is that the printer heatbed and right extruder are not heating up prior to print using a dual extruder profile.

I have verified that the gcode is being corrently built (opened in ReplicatorG) but something is being lost in the x3g conversion.

I have taken the Slic3r gcode and created the x3g file using ReplicatorG and it works fine when printed.

any ideas?


More than likely you've got the gpx gcode flavor set to reprap, but Slic3r set to produce makerbot/sailfish gcode. You can either: set Slic3r to produce reprap flavor gcode (then that gcode won't work with RepG only gpx) ...or... set gpx to makerbot/repg flavor via the -g command line option or gcode_flavor=makerbot in gpx.ini.

Hi Danno25, look this: https://www.youtube.com/watch?v=l3Gw6i7qz9I

Robo papa fez tudo.

I have added gpx.py in cura plugins folder, and it showed up on the list in cura software, then I enable plugin set the path of gpx.exe file, machine type. Then I import file clicked on save gcode and I cannot find .x3g file. What am I doing wrong or missing out PLEASE help!

(Sorry for my bad english) ,THANKS

Hi, i've found that it puts the .x3g file in the same directory as the original .stl file you imported. hope that helps!

Hi, I don't know how can i do to use the program. Someone can explain me that? Or if you have a link of a tutorial or guide. Thanks!

Hi, I'm not the best programmer but I was able to generate the x3g files. This may not be the most efficient way of generating the file but this what worked for me. If anyone knows a better way doing this, please let me know! :)

For Macs:

  1. Download and open gpx-osx-1.5.dmg
  2. Copy the files into a new folder and name that folder gpx-osx (for me, I placed that folder onto the desktop)
  3. Copy the gcode that you want to convert into the gpx-osx folder.
  4. Open up terminal and navigate to the gpx-osx folder (in my case I typed: cd Desktop\gpx-osx [hit enter])
  5. To convert your gcode (mine is z_motion_cont.gcode) to x3g for the makerbot replicator 2, type into terminal: /Users/Lisa/Desktop/mac-gpx/gpx z_motion_cont.gcode [hit enter]
  6. Now, in the extracted gpx-osx folder, you should see z_motion_cont.x3g
  7. Copy that file into your SD card
  8. Place SD card into your makerbot and build the file z_motion_cont.x3g

For Windows:

  1. Download and extract the gpx-win32-1.3 zip. (I extracted mine to the desktop folder)
  2. Copy the gcode that you want to convert into the extracted gpx-win32-1.3 folder.
  3. Open command prompt (start menu->all programs->accessories->command prompt)
  4. And navigate to the extracted gpx-win32-1.3 folder (in my case I typed: cd Desktop\gpx-win32-1.3 [ hit enter])
  5. To convert your gcode (mine is z_motion_cont.gcode) to x3g for the makerbot replicator 2 ,type into command prompt: gpx z_motion_cont.gcode [hit enter]
  6. Now, in the extracted gpx-win32-1.3 folder, you should see z_motion_cont.x3g
  7. Copy that file into your SD card
  8. Place SD card into your makerbot and build the file z_motion_cont.x3g

My guess is that that program isn't used in Windows 10 (which is what I'm using), so after step two I'm lost again.

didn't work. It says that gpx isn't a recognizable command

Works great for me! Thanks!

Hi! Can you add support G2 and G3 code?

Hey. Thanks for this. Super Useful.
Do I need any sort of drivers or anything for serial communication with a Makerbot?

Thank you for this supergood direct post-processor!
In the next version, would it be possible to add a TOM with MK8-gear diameter in single and dual Version? Then I could post directly out from KISSlicer to print with the new "tuned" smaller MK8 gear-diameter!
Best regards!

Is there gpx-linux Version1.4 because I found only version1 for linux and M133 to M137 are not recognized.

Sorry for not understanding, but how the heck do you upload your gcode? I'm running Mac OSX and the program opens in the terminal.

I just wanted to thank you as well for this awesome program. I don't think most people understand, this is why they can use all their different slicers with MakerBot machines. Without this, there is no SImplify3D functionality on Replicators!

It's pathetic how little progress I've made, but I'm curious to say the least.
./gpx -m r2 /Users/grigorichulaki/Desktop/xxxxxxxx/taperedtube3.gcode taperedtube.x3g
(line 2) Semantic warning: M140 cannot select non-existant heated build platform
(line 5) Semantic warning: M190 cannot select non-existant heated build platform
(line 46815) Buffer overflow: input exceeds 1023 character limit, remaining characters in line will be ignored
(line 2) Semantic warning: M140 cannot select non-existant heated build platform
(line 5) Semantic warning: M190 cannot select non-existant heated build platform
(line 46815) Buffer overflow: input exceeds 1023 character limit, remaining characters in line will be ignored

Luxs-MacBook-Pro:~ luxe$ cd downloads/gpx-2
Luxs-MacBook-Pro:gpx-2 luxe$ gpx -c r2 taperedtube3.gcode taperedtube3.x3g
-bash: gpx: command not found

Compiled but still at a loss. ANy advice will be appreciated.

On Unix, the current directory is not in the search path for commands. Which is a good thing, to prevent viruses from spreading by putting things like 'ls' into a directory. To get things going, you have to run
./gpx -c r2 taperedtube3.gcode taperedtube3.x3g

Hello, I would really like to be able to try this out. Are there any instructions on how to use it?

Which gcode pattern I should use in slic3r ? coz G28 command doesn't work. Printer print on air.

Wow great stuff. I feel like it would really benefit from a GUI front end.

Any help for a person who can't use it please?

Could you point me to the instructions please?

Thank you very much for spending your time creating this very useful tool, saves a lot of time!

Awesome stuff... yet again. Do you ever sleep?

I program in my sleep =)

How about a processor the other way around?

Compatible with Sailfish, I imagine?

Yes in fact it was the first to support the new M322 Pause @ zPos