Writing and saving Gcode inside unity

Hi there,

I was wondering about a way to create gcodes based on points given by a user and outputting those in a file just like a regular .gcode file to use in a robotic arm i’m working on.
Now as i’m not sure where to start looking when it comes to writing the lines in a file i was hoping you could help steering me in the right direction!
Any help is much apreciated :slight_smile:

Here’s a screenshot of the application so far:

hate to bump, but any suggestions?
Doesn’t need to neccesarily be a .gcode for example .txt would work too, as long as the lines inside the file can be custom