algorithmic modeling for Rhino

Lately I've found myself jotting down and formatting notes in Grasshopper then exporting to a text file. (If this is strange to you, I understand completely.) So I've written a quick script making that workflow a bit easier. I know there are other codes out there, but I thought it might be interesting to share nonetheless.

There are some simple built-in safety protocols. It checks for an existing file path first then proceeds with the exporting process. If the specified file contains data the user is prompted with a warning, asking him/her to allow an overwrite or specify a new path.

It also works with CSV files. You will need GHPython.

You're welcome to download it here. Image of it in use below.


EDIT 05/2016: The above file now includes the latest script with the additional functions (append, relative path, etc.).

Views: 7879


You need to be a member of Grasshopper to add comments!

Join Grasshopper

Comment by Francesco De Luca on August 14, 2019 at 6:47am

Thank you for the useful component.

Comment by Stephen Maher on June 30, 2017 at 6:20am

Hm. I've never seen those characters before. What text editor are you using?

Comment by Philippe HAMON on June 25, 2017 at 11:38am

Thank you for your answer, CIX is an extension for Biesse woodworking CNC machines, but in reality it's a simple text file, your export grasshopper component adds an annoying "CR" character. Finally I found another GH component which directly writes the text file with the CIX extension and without the "CR" character, it looks more suitable for my needs.

Comment by Stephen Maher on June 25, 2017 at 10:52am

Philippe – I've never tried using this particular script with a CIX file. Do you mind posting the file so I can take a look?

Comment by Philippe HAMON on June 24, 2017 at 4:14am

hi, in the original data set, the text has only got "CRLF" hidden character:

but in the exported data, i find new characters "CR" added:

 it's annoying, because the CAM software can't directly open the exported file "syntax error", do I miss something?

Comment by Stephen Maher on April 19, 2017 at 6:11am

tsaohy – What .gcode are you referring to? This is a Python code that only requires the GHPython scripting component.

Are you trying to write a .gcode file with this script?


Comment by tsaohy on April 19, 2017 at 4:39am

Hi Stephen. Thanks for sharing this GH file. However, the gcode one doesn't work for me, I'm not sure why, there is no any .gcode file showing up. Thx for helping.

Comment by Stephen Maher on October 23, 2016 at 8:09am

Hey Patrick, mind posting your file so I can take a look? Or shoot me a DM with the file.

Comment by Patrick Monte on October 22, 2016 at 11:33pm

This would be really useful to me because I am doing some operations that max out the panel character limit. I've tried writing to excel, but there again hit cell character limits, so I really need to be able to write a text file directly. I seem to be getting encoding errors though:

1. Solution exception:'ascii' codec can't encode character '\u2019' in position 54

Comment by Nick Devlin on May 27, 2016 at 9:18am

thanks Stephen.





  • Add Photos
  • View All


  • Add Videos
  • View All

© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service