algorithmic modeling for Rhino

Dear All,

I hope you are well,

I am a new grasshopper user and I'm currently using silkworm to create G-code file for 3D printing on a makerBot printer.

I was able to get the final G-code as a text out of grasshopper, but I still can't export it as a G-code file.

I tried slic3r to export G-code files out of obj. and stl. files before, so kindly if you can help me export the text file somehow to one of the previous mentioned file types (obj., stl., or G-code)

Many Thanks

Views: 4039

Replies to This Discussion

Hi Ayham,

I've also did a simple tool to create a G-code for a 3-axis cam.

At the end of the definition I attached a panel, and when I want to export the data, just right-click over it and "copy data only".

An then i paste it in a .txt file.

Would it work like this?

Hello Riccardo, Yes It does work like this but after creating this .txt file were you able to transform it to a .gcode, .stl, or .obj file?


Here's the workflow for 3dprinting as i know it:

1 design concept

2 creating geometry (mesh as .stl , .obj or such file)

3 creating supports geometries (mesh as .stl , .obj or such file)

4 slicing with a software that outputs a g-code file (like grasshopper), it can be a .txt , .iso or whatever... but not again an .stl or .obj file!

Ugually g-code files are a very simple format, like again, a .txt or .iso .

The way that your 3dprinter "use", "read", or "eat" that file, i don't know it....

I think that, making the g-code file is not a problem; grasshopper can be useful, and here, indeed, you can find some help in doing that. (Is this your problem?)

But for how to "give" the g-code to the printer, you should search in dedicated MakerBot forums.

Or, maybe someone other can help you in that....I can't, sorry.

(Edit. Maybe my english hurt your eyes... sorry for that)

Hi Ayham,

Do you mean exporting the text at the end of Silkworm as G-Code?

Have you tried right clicking on panel to copy text and then paste it in a notepad and saving as .gcode?

All the best,


Thank you Arthur, it has worked I didn't know it can be as simple as that actually.

Thanks again,

Thank you Arthur, it has worked I didn't know it can be as simple as that actually.

Thanks again,

Hi Arthur,

Thanks for your message. I am exporting gcode to makerbot replicator 2 for the first time and the machine is not reading the file.

Could you please suggest me how can i make the machine read the file?

Also I am concerned about the origin of the print.. Will it automatically print in the center of I have to position it in Rhino..?

Looking forward for your reply.



Like Arthur, I've always understood GCODE to be an easy TXT document transfer.

Attached is a Python script that allows you to export text with a given file extension. Just use ".gcode" and set "write" to True.



hello Stephen, well yes it seemed to be easy as Arthur has said, but the python script seems quite helpful too, I have tried to download it, but apparently the latest version on food4rhino is not exactly the same as this one. do u have the link to download it?


I'm using the latest version of GHPython ( Are you sure you have the latest component?


Hi Stephen, 

Thanks for the python code. I have tried to introduce it but it seems that by pushing the button, the Python code still remain "orange" and no file is generated. Do you have a solution ?



Apologies for the delayed reply. Mind posting your file?







  • Add Photos
  • View All

© 2020   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service