SoftJaw G Code Editor for VS Code
(Formerly NC Ops.)
Bookmarks for every operation in a posted CNC program, each with a predicted run time, color-coded G-code, and the
toolpath in 3D.
Open a posted G-code file (.nc, .hnc, .tap, .ngc, …) and SoftJaw G Code Editor lists its operations in a side panel, like
bookmarks. Next to each one is how long it will take on the machine. The times come from a look-ahead motion model,
the way a modern control actually moves, not from distance ÷ feed. As you scroll, a second panel shows the predicted
runtime at the line you're looking at, so you can hold it up against the control's own runtime readout.

See it work
Jump between operations. Click a bookmark and the editor goes to that operation. The runtime panel and the
status bar follow.

Scroll, and the runtime follows. Here the view scrolls from the end of one operation into the next: the panel
switches op, the list moves its highlight, and the predicted runtime climbs.

Times on or off. The clock button in the panel title, or the clock in the status bar, shows or hides the time
on each operation's line.

Color-coded G-code
Every word is colored by what it does, so you can read a program at a glance. Rapids are red and cutting moves
blue, the same as in the toolpath view. That holds for the X, Y and Z of a line with no G word too, because the
color follows the motion mode carried over from the last G0/G1/G2/G3, the way the control reads it. Stops (M0,
M1, M30) stand out on an orange highlight, and a tool change is bold yellow.

Hover any code to see what it does: G43, M8, G68.2, F120., or Z0.1 ("Z position, on a rapid (G0)").
Turn the colors off with ncOps.colorCode (or Toggle color-coded G-code in the Operations panel's … menu),
and the hovers with ncOps.explainCodes. To change a color, set it in your settings:
"workbench.colorCustomizations": { "ncOps.rapid": "#ff5555", "ncOps.cutting": "#44aaff" }
The colors: ncOps.rapid, ncOps.cutting, ncOps.setupCode, ncOps.mCode, ncOps.stop (and
ncOps.stopBackground), ncOps.tool, ncOps.feed, ncOps.speed, ncOps.blockNumber and ncOps.comment. Each has
dark, light and high-contrast defaults.
The Toolpath panel draws the program in 3D. Drag to spin it, right-drag (or shift-drag) to pan, and scroll to zoom.
Fit, Iso, Top, Front and Right set the view. Click a move and the editor goes to its line.
Hovering a move shows its block and its operation. ⛶ Open large puts the view in an editor tab next to the
program, and ⛶ Maximize fills the window with it.

It follows the editor: the line you're on lights up, with the tool at the end of its moves. The operation you're in
is drawn in full, and the others go faint. You can also hide them or show them all.

Play it. Type a line (or leave the box empty to start at the editor's line) and press ▶ Play, or press
space. The tool moves along the path at the speed the time model predicts, so a finishing pass crawls and a rapid
flies. The slider sets the speed from 1× (real time) to 1000×, and the clock shows the predicted runtime, tool changes
included. With Editor follows on, the editor moves along with the tool. ■ stops and goes back to following the
editor.

The legend says what each color means. Coloring by op lists the operations with their times, and you can click
one to go to it. Coloring by tool lists the tools with their descriptions from the program's header.

Up to here draws only the moves up to the editor's line, so scrolling down the program plays it back too.

3+2 programs come out right. Each tilted work plane is turned back onto the part, so the operations land on the faces
they cut. It reads G68.2 with the rotary angles the table sits at (Hurco; Fusion's default for table-table
machines), with the plane's X and Y vectors, or with Euler angles.

Check it with NC Check
NC Check is a free checker that replays a posted program against a voxel
model of the stock, tool and holder included. It finds crashes, gouges, rapids through material, vise contact and air
cutting. SoftJaw G Code Editor is its front end: Check with NC Check (the shield in the Operations or Toolpath panel title, or
✓ Check in the toolpath view) sends the open program to it and shows what it finds where you're working:
- In the editor: each finding is an error on its line, in the Problems panel and as a squiggle.
- On the toolpath: a mark at each flagged line, red for a crash, purple for a gouge, orange for a rapid through
material, yellow for the vise. The legend counts them, and hovering a move says what was found.
- In the ops list: each op's air-cut time and how many of its moves have problems.
- The stock: Open the NC Check stock viewer shows the stock after each op in 3D, in a tab.

To set it up:
- Get NC Check and run its setup once (see its README).
- Export the job's check bundle (the part, stock, fixtures and tools) into a folder beside the program, for
example
bundle/. Fusion users run NC Check's ExportCheckBundle script.
- Click Check with NC Check. The first time, SoftJaw G Code Editor asks where NC Check is (
ncOps.check.folder). If it
can't find the bundle beside the program, it asks for that once too and remembers it for that file.
Results go beside the program in <program>.nccheck/. A check run from the command line into that folder shows up
when you open the program. A check older than the program says so on every finding.
| Setting |
|
ncOps.check.folder |
the NC Check folder |
ncOps.check.python |
its Python, if not the .venv its setup made |
ncOps.check.voxel |
voxel size, mm (0.5; 1 for a quick look) |
ncOps.check.useGpu |
use the GPU checker when PyTorch is installed (on) |
What you get
- Operations, as bookmarks. One entry per operation, with its time and tool. Click one to jump to it. Step
between ops with the arrows in the panel title or Ctrl+Alt+↑ / ↓. Hover an op for its split into feed, rapid
and tool change time, and the runtime when it starts and ends.
- Times in the editor.
⏱ 9:38 · @ 0:08:12 at the end of each operation's line: how long it takes and the
runtime when it starts. Turn this on or off with the clock button in the panel title, or click the clock in the
status bar.
- Runtime here, and when it ends. The predicted runtime at the highlighted line (the cursor; the top line of the
editor when the cursor is scrolled off), with its N block number. Under it, Program ends at 3:42 PM: the clock
time the program finishes if that line is running now, updated every second, and the time that op ends. It also
shows which operation you're in, how far through it you are, and the time left. The op list scrolls along with
you, and the status bar shows the end time too.
- Go to a line or an N number. The box at the top of the runtime panel: type
54938 for that line of the file,
or N54927 for that block (the next one after the cursor), and press Enter. (VS Code's own Ctrl+G goes to a line
too.)
- Bookmark marks in the gutter and the scrollbar, so op boundaries are easy to see in a 300,000-line file.
- Color-coded G-code: rapids red, cuts blue, stops highlighted, with a hover that explains each code.
- The toolpath in 3D, which spins, hides rapids and points, plays the program at its predicted speed, has a
legend, and goes to the line of any move you click.
- A front end for NC Check: crashes, gouges and rapids through material, as errors on their lines and marks on
the toolpath.
- A calibration wizard that fits the times to your machine from the run times your control shows: no numbers to
look up.


Install
- VS Code Marketplace: search for SoftJaw G Code Editor in the Extensions view, or run
ext install softjawdesign.nc-ops from
Quick Open (Ctrl+P).
- From a release: download
nc-ops.vsix from
Releases, then run
code --install-extension nc-ops.vsix (or Extensions → … → Install from VSIX).
Then open a posted program and click the SoftJaw G Code Editor icon (a drill bit) in the activity bar. To try it right
away, open examples/demo.nc, or examples/five-sides.nc for a 3+2
program.
How it finds operations
CAM posts write each operation's name as a comment line, for example (OP1 Rough 12 bull T3500) or (Pocket1).
SoftJaw G Code Editor treats every whole-line ( … ) comment as an operation, except the tool list ((T1 D=0.5 …)) and the
(Machine) block at the top. That matches Autodesk Fusion's posts. If your post writes other comments too, set
ncOps.opHeaderPattern to a regular expression that only operation lines match (it's tested against the text
inside the parentheses).
How it predicts time
The program is replayed the way a control with look-ahead moves:
- Every move is a straight segment with its programmed feed (arcs are split into chords of 5° or less), and G0
moves at the rapid rate.
- The axes share one acceleration. Each move speeds up, cruises and slows down (a trapezoid), and the planner looks
ahead so it doesn't slow down when it doesn't have to.
- Corners limit speed: a sharp corner forces a near-stop and a gentle one barely slows down (junction deviation,
the same corner rule grbl uses). Arcs also respect
v ≤ √(a·r).
- Fixed costs come on top: seconds per tool change (
M6), per M140 (on a Hurco, Z home plus the rotary
reorientation between operations), and at program start.
This is why the times run longer than the CAM system's estimate. Short moves never reach their programmed feed, and
CAM estimates (Fusion's included) ignore acceleration.
Defaults: the numbers were fitted on a Hurco VM10Ui 5-axis against its own runtime readout:
|
Default |
Setting |
| Rapid |
1102 in/min |
ncOps.motion.rapidIpm |
| Acceleration |
45 in/s² |
ncOps.motion.accelInS2 |
| Corner tolerance |
0.002 in |
ncOps.motion.junctionDeviationIn |
| Tool change |
47 s |
ncOps.motion.toolChangeS |
M140 (Z home + reorient) |
8 s |
ncOps.motion.zHomeS |
| Program start |
0 s |
ncOps.motion.programStartS |
On the program they were fitted on, the model lands within 1 s of the control on every stretch of cutting.
Fit it to your machine: the wizard
You don't need to know any of these numbers. Click the beaker in the Operations panel title (or SoftJaw G Code Editor: Fit
times to my machine…, or the link under the runtime panel):
- Run a program and note the run time the control shows at the end. That one time is enough to start. For
sharper numbers, also note the clock at the start of an operation or two; the wizard lists every place you can
read it.
- Type the times in, the way the control shows them (
0:33:50).
- Click Work out my machine's numbers. SoftJaw G Code Editor back-solves the acceleration, corner tolerance, tool change time
and cycle-start time that fit your times. It shows each reading before and after, and saves the numbers with one
click.
No timed run yet? Make a test program creates a 4-minute air cut with Z at machine home and no spindle. It has
five short sections (long feeds, tiny back-and-forth hops, corners, arcs, rapids, plus tool changes if you like),
each ending at an M0 stop where you read the clock. Try it with example readings walks you through the whole
thing with times from a made-up machine. Those example numbers can't be saved by accident.

How it works: between two readings, the real time is the planner's motion time plus a whole number of tool changes,
Z homes and the start. For each acceleration and corner tolerance, those fixed costs are solved by least squares.
Each one is held near its current value when your readings can't tell it apart, so one total time won't throw the
tool change time off. On the program the defaults came from, its six photos of the control give 43.5 in/s² (against
the 45 fitted by hand) and land every photo within a second.
Share your numbers from the result: it opens a GitHub issue with them, so the next person with your machine can
skip the test.
A machine file
To share one set of numbers across projects, or to keep them in version control, put them in a machine file and
point ncOps.machineFile at it (~ and ${workspaceFolder} work). SoftJaw G Code Editor watches the file, so new numbers
show up as soon as you save it:
{
"rapid_ipm": 1102,
"motion_fit": {
"accel_in_s2": 45,
"junction_deviation_in": 0.002,
"tool_change_s": 47,
"op_change_same_tool_s": 8,
"program_start_s": 0
}
}
The ncOps.motion.* settings override the file.
Limits
- Canned cycles (
G81–G89) aren't timed or drawn yet. Posts that write drilling as G1/G0 moves are fine.
- The toolpath view leaves out moves it can't place: the first move,
G53 and G28 moves, and the moves after a
Z home (M140) until Z is programmed again.
- Tilted planes given as table angles use the ISO directions: a positive angle turns the tool right-handed about
+X, +Y or +Z relative to the part. If your machine's rotary runs the other way, the side ops are drawn mirrored.
5-axis simultaneous moves are drawn from their X, Y and Z (with TCP on, that's the tool tip on the part).
- Rotary moves (A/B/C) aren't timed on their own. On a Hurco, the
M140 cost covers the reorientation between
operations.
- Units: inch (
G20) and mm (G21) both work. The machine numbers are always in inches.
- Only
( … ) comments mark operations; ; comments don't.
Development
npm test # the model (hand-checked trapezoids, mm vs inch, the demo program) and the extension against a VS Code stub
npm run demo # rebuild examples/demo.nc
npm run package # nc-ops.vsix
No dependencies: plain JavaScript, and the VS Code API.
Credits
Made by Chris Rouxel at SoftJaw Design, a one-machinist 5-axis CNC shop in
Houston, Texas. It came out of programming our own jobs in Autodesk Fusion for a Hurco VM10Ui. Its page is
softjawdesign.com/nc-ops, next to our other
free tools.
MIT License. Not made or endorsed by Autodesk or Hurco; their names are trademarks of their owners.