Edit Gcode to remove all G1 Z....
-
I need to edit a standard but very long Gcode from Simplify3D and get a new Gcode with all G1 Z set to 100 for testing purpose.
I am trying with sublime text editor to find Z and replace with Z100 but when the program find Z4 it then becomes z1004.
thx!
-
@paboman I think you can use grep searches in Sublime, with which you can be more specific, and yet more flexible, about your search and replace; I do something similar using BBedit on macOS.
eg find "[beginning of line]G1[space]Z[numbers after until space (assuming there's a speed command)]" replace with "G1[space]Z100". On BBedit it would be:Find:
^G1 Z.*
there's a space after the *
the ^ means start search at beginning of the line
the .* means find any character, repeat until next search character, which is space in this case.Replace: 'G1 Z100 '
Again, there's a space after the Z100.For me, this changed
G1 Z0.300 F4800.000
(and all other instances) toG1 Z100 F4800.000
, and didn't touch any other G commands.If there's X and Y commands between G1 and Z# then it gets a little more complex, but you can usually format a grep search to handle it! If in doubt, post a snippet of the gcode and I'll suggest a suitable search and replace.
Ian
-
@paboman Alternatively, notepad++ (which is free) will do what you want quickly and easily using "Search" - "Replace". Just remember that when you "save as" by default, it will add .txt to the end of the file so you need to remove that extension. Or you can associate .g files with notepad++ then it won't add the .txt extension.