# From Part to G-code in One Chat

Ask Flux to machine the part it designed. Get mill toolpaths, G-code, a preview, and a setup sheet in the same project as the board and enclosure.

Written by [Matthias Wagner](https://www.flux.ai/natarius)

Published Oct 2026 - 3 min read

![From Part to G-code in One Chat](https://www.flux.ai/p/assets/blogs/from-part-to-gcode-in-one-chat/main.webp)

Priya is the mechanical lead at a company that makes industrial sensor units. Each unit has a main board, an enclosure, and an aluminum bracket that holds the unit on a machine frame. In Flux, the board, the enclosure, and the bracket took a few hours.

Without Flux, machining the bracket took another week. Somebody exported a STEP file, opened it in a separate CAM tool, and set up the stock, the tools, and the operations again by hand. Then the bracket changed by 2 mm, and that whole setup had to be done again.

## Ask Flux for the G-code

Priya tells Flux the machine, the stock, and the workholding in the first prompt:

> "Make 3-axis toolpaths for the bracket in this project. Stock is a 6061 block in a 6 in vise on 4 mm parallels. Tabs are fine for the final profile. Pick the cutters yourself and give me the G-code file and a toolpath preview."

Flux then:

1.  **Reads the part.** It finds the outline, the four M4 holes, and the 20 mm center slot.
2.  **Plans the operations.** These are facing, the holes, the slot, and the profile. Flux picks a cutter for each operation and sets the speeds and feeds for aluminum.
3.  **Writes the G-code** for your mill, with the work zero and the tool numbers.
4.  **Shows each operation** in a toolpath preview, so you can see every cut before you go to the machine.
5.  **Writes a setup sheet** to the project files. It lists the stock, the tools, the work zero, and the workholding.

![Flux chat with the toolpath preview of the facing, hole, slot, and profile operations for a 6061 aluminum bracket](https://www.flux.ai/p/assets/blogs/from-part-to-gcode-in-one-chat/preview.webp)

## Open it anywhere

The G-code is a standard `.nc` file. Open it in your machine controller or in any G-code viewer.

![G-code file from Flux open in a G-code viewer with the toolpaths for the bracket holes, slot, and profile](https://www.flux.ai/p/assets/blogs/from-part-to-gcode-in-one-chat/gcode.webp)

## One project, from the board to the machine shop

The bracket, the enclosure, and the board are in the same project. When the board grows by 4 mm, Priya asks:

> "Make the enclosure 4 mm longer for the new board, move the bracket holes to match, and give me new G-code for the bracket."

Flux changes the board fit, the enclosure, and the bracket, and it makes the new G-code in the same turn. No file goes to a separate CAM tool, and no setup is done twice.

## More prompts

> "Make the facing, drilling, and pocket toolpaths for this enclosure lid in 6061. Use a 6 mm flat end mill and a 3 mm drill. Give me the G-code and the setup sheet."

> "Make 3-axis toolpaths for the motor mount. My mill has a Fanuc controller. Stock is a 100 x 60 x 12 mm block in a 6 in vise."

> "Design a heat sink for the regulator on this board, then make the toolpaths to mill it from a 6061 plate."

## Before and with Flux

|  | Before | With Flux |
| --- | --- | --- |
| CAD to CAM | Export STEP, import it in a CAM tool | Same project |
| Setup | Stock, tools and operations set up again by hand | Told once in the prompt |
| A design change | Redo the CAM setup | One prompt changes the part and the G-code |
| Shop handoff | Screenshots and notes | G-code, preview and setup sheet in the project files |
| Time | Days | Hours |

**Try it:** open a project with a mechanical part and ask Flux to make the toolpaths. See [Make mechanical parts](https://docs.flux.ai/reference/make-mechanical-parts) in the docs.

## About the author

[Matthias Wagner](https://www.flux.ai/natarius)

Founder & CEO at Flux

Matthias is the Founder and CEO of Flux, a hardware design platform that's revolutionizing how teams create and iterate on circuits. Find him on Flux [@natarius](https://www.flux.ai/natarius).

Let’s start building

Build your big idea together with Flux. All you need to do is describe what you want to make, or what problem you want to solve. Flux will work with you to make it a reality.

![Close-up photo of a PCB made with Flux, with an ESP32 module, buttons, and a microSD slot.](https://www.flux.ai/p/assets/blogs/miscellaneous/sidebar-cta-pcb.webp) [Try it Free](https://www.flux.ai/signup)

## Related Content

[

![Technical isometric illustration in glowing teal on charcoal, showing an exploded multilayer circuit board beside an enclosure and a bracket, with an eye diagram, a frequency response, a field map, and a magnifying lens around it](https://www.flux.ai/p/assets/blogs/pcb-design-review-without-altium-license/main.webp)

### PCB Design Review Without an Altium License: SI, PI, EMC, and DFM in Every Flux Plan

7 Min Read](https://www.flux.ai/p/blog/pcb-design-review-without-altium-license)[

![Illustration of a circuit board and signal integrity analysis](https://www.flux.ai/p/assets/blogs/pcb-signal-integrity-simulation-every-board/main.webp)

### PCB Signal Integrity Simulation for Every Board: S-Parameters, TDR, and Eye Diagrams in Flux

4 Min Read](https://www.flux.ai/p/blog/pcb-signal-integrity-simulation-every-board)[

![Illustration of a factory line in glowing teal line art: a circuit board between the two halves of a sheet-metal enclosure moves on a conveyor under an inspection scanner, with a press brake and sheet-metal blanks behind it](https://www.flux.ai/p/assets/blogs/ai-generated-hardware-designs-that-work/main.webp)

### AI-Generated Hardware Designs Have to Work, Not Just Get Ordered

6 Min Read](https://www.flux.ai/p/blog/ai-generated-hardware-designs-that-work)[

![Illustration of two circuit boards with different part placement above one assembled device, with the board in its enclosure, the lid above it, and a test probe on a glowing trace](https://www.flux.ai/p/assets/blogs/how-to-evaluate-ai-pcb-design/main.webp)

### How to Evaluate AI-Generated PCB Designs: Judge the Board by Whether It Works

6 Min Read](https://www.flux.ai/p/blog/how-to-evaluate-ai-pcb-design)[

![Illustration of a circuit board with glowing teal traces and a pair of parallel traces from a connector, with the enclosure parts of the device around the board](https://www.flux.ai/p/assets/blogs/agentic-routing/main.webp)

### Route Your Board in the Flux Chat: Pairs, Lengths, USB-C, Fanout, and Every Edit After

6 Min Read](https://www.flux.ai/p/blog/agentic-routing)[

![Illustration of a smartphone with a microphone button and a voice waveform whose lines run into an exploded view of a circuit board and its two-part enclosure, in glowing teal line art](https://www.flux.ai/p/assets/blogs/eda-and-mcad-on-your-phone/main.webp)

### EDA and MCAD on Your Phone: Dictate the Hardware You Want to Build

6 Min Read](https://www.flux.ai/p/blog/eda-and-mcad-on-your-phone)

See All (6)

## Let’s start building.

Let’s build your idea together. All you need to do is describe what you want to make, or what problem you want to solve. Flux will work with you to make it a reality.

[Try it Free](https://www.flux.ai/signup)

 ![Close-up of a Flux-designed printed circuit board](https://www.flux.ai/p/assets/homepage-v2/mission-visual.webp)
