G-Code question: How to highlight XYZ... coordinates lacking a "dot"?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
SG.Hydro
Posts: 1
Joined: Mon Mar 31, 2025 1:08 pm

G-Code question: How to highlight XYZ... coordinates lacking a "dot"?

Post by SG.Hydro »

Hi all,

I'm using textpad to write G-Code for a CNC mill, the issue is that in this mill in you forget a "dot" in the number you use for coordinate the machine defaults to microns.

So if I write for example

Code: Select all

G01 X120. F1000
the machine will move (G01 command) to coordinate 120.0mm in whatever coordinate system is selected at 1000mm/min (F command) but if type

Code: Select all

G01 X120 F1000
then the machine will move to coordinate 120 microns (so 0.12 mm)

This is hard to spot and can lead to some bad crashes.
To make thing even worse the dot needs to be used for coordinates (so XYZIJKARQ characters) but not for other commands like spindle speed (S), cutting speed (F), iterations (L) calls (P) etc... it's a fuckign mess...

I'm using my custom syntax coloring to make the code easier to visualize and I've defined

Code: Select all

OperatorChars = XYZIJKLNPSRFQA
with a nice dark red and numbers in black

What I would like to do is have any operator chars where I have forgotten the bloody dot to get highlighted
So

Code: Select all

X451.
woudl appear as a Red X followed by black 451.
but

Code: Select all

X451
would appear highlighted until I type that bloody dot

Is this feasible ?
Last edited by AmigoJack on Mon Mar 31, 2025 8:53 pm, edited 1 time in total.
Reason: formatting code as code; adding question mark to question
User avatar
AmigoJack
Posts: 560
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Re: G-Code question : How to highlight XYZ... coordinates lacking a "dot"

Post by AmigoJack »

SG.Hydro wrote: Mon Mar 31, 2025 1:27 pmThis is hard to spot
Wouldn't it help more to use a font where you see the dot more clearly? A monospaced font should already help, since the dot as character would eat a lot of space, making it visually more clear where it may be missing. Or better: a modified font with an extra big dot.
Post Reply