top of page

013 – Files as input and as output

Updated: May 16

Pasting your data into and out of Grasshopper

Are you manually pasting your data into and out of Grasshopper? Connect the input of your model to a local file using the File Path and Read File components, so it automatically reads its contents and updates your model. Stream the contents of your data panel to a text file or .csv, so that the result of your Grasshopper logic is saved in a file format you can easily read. Automation can be easy and fast!


Prerequisite: A graph where you want to connect the input of your model to a local file.


Steps:

Step 1: Add a 'file path' component to your graph along with a 'read file' component.

Step 1: Files as inputs and as outputs in Grasshopper

Step 2: Right click on the 'file path' component and select the file that you would like to connect.

Step 2: Files as inputs and as outputs in Grasshopper

Step 3: Use a wire to connect the 'file path' component and the 'read file' component. Then connect to your graph

Step 3: Files as inputs and as outputs in Grasshopper

Step 4: Select the 'file path' component and the 'read file' component then right click to choose "add to group"

Step 4: Files as inputs and as outputs in Grasshopper

Step 5: Now you can play around with the parameters.

Step 5: Files as inputs and as outputs in Grasshopper

Step 6: Using the 'Stream contents' function of panels, you can save the results of your Grasshopper logic in a text file or a spreadsheet. Right click on what you would like to export and choose 'stream destination' and select the desired file.

Step 6: Files as inputs and as outputs in Grasshopper

Step 7: Then right click again and choose 'stream contents'. In this example we open it with notepad. You can see the list of data appear.

Step 7: Files as inputs and as outputs in Grasshopper

Learn more

Read our previous blog post or sign up to our platform here to put your Grasshopper models online and share them.

13 views

Recent Posts

See All
bottom of page