# 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://flux.seobdtools.com/natarius)

Published Oct 2026 - 3 min read

![From Part to G-code in One Chat](https://flux.seobdtools.com/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://flux.seobdtools.com/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://flux.seobdtools.com/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://flux.seobdtools.com/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://flux.seobdtools.com/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://flux.seobdtools.com/p/assets/blogs/miscellaneous/sidebar-cta-pcb.webp) [Try it Free](https://flux.seobdtools.com/signup)

## Related Content

[

![Teal technical illustration of a circuit board and enclosure with hand-drawn circles and arrows](https://flux.seobdtools.com/p/assets/blogs/markup-mode/main.webp)

### Circle it. Ask Flux. Markup mode is here

3 Min Read](https://flux.seobdtools.com/p/blog/markup-mode)[

![Teal line art of a desktop monitor with a tangled circuit board, a mouse and a cursor on the left, and a clean exploded eight-layer circuit board with length-matched traces on the right, on a dark background](https://flux.seobdtools.com/p/assets/blogs/ai-computer-use-altium-pcb-routing/main.webp)

### AI Moving a Mouse in Altium Is the Worst Way to Design a PCB

7 Min Read](https://flux.seobdtools.com/p/blog/ai-computer-use-altium-pcb-routing)[

![Line illustration: a rigid-flex circuit board above its fabrication drawing sheet, with a drill pattern, an exploded layer stackup, and the enclosure shell for the board](https://flux.seobdtools.com/p/assets/blogs/pcb-fabrication-drawing/main.webp)

### Your PCB Fabrication Drawing Now Comes From the Design

6 Min Read](https://flux.seobdtools.com/p/blog/pcb-fabrication-drawing)[

![Teal isometric line art of a circuit board and mechanical enclosure surrounded by a cycle of arrows on a dark background](https://flux.seobdtools.com/p/assets/blogs/ai-agents-hardware-design-self-directed-work/main.webp)

### The Future of AI Isn't Better Prompting. It's Agents That Drive Their Own Work.

6 Min Read](https://flux.seobdtools.com/p/blog/ai-agents-hardware-design-self-directed-work)[

![Copilot scanning a board for components with EOL and NRND lifecycle status](https://flux.seobdtools.com/p/assets/blogs/ai-supply-chain/main.webp)

### AI Gives You the Power of an Entire Supply-Chain Team

3 Min Read](https://flux.seobdtools.com/p/blog/ai-gives-you-the-power-of-an-entire-supply-chain-team)[

![Flux copilot, a hardware design assistant is responding to a user request to provide him drop-in replacement for an electronic component in his project. Behind is a complicated realistic printed circuit board.](https://flux.seobdtools.com/p/assets/blogs/streamline-component-research-with-ai/main.webp)

### Streamline Component Research with AI

2 Min Read](https://flux.seobdtools.com/p/blog/streamline-component-research-with-ai)

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://flux.seobdtools.com/signup)

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