Grasshopper to Excel and Back Workflow

Course or Collection: 
Software: 
Video Duration: 
18 minutes
Author: 
Zach Downey

OK, This is an updated version of one I did awhile back that illustrates a pretty easy way to get data into and out of Microsoft Excel without using any additional plugins.  It uses the panel components to stream the data from Grasshopper to a CSV (Comma Separated Value) text file.  This file is used as a Data Link with Microsoft Excel to create and active connection to the live data.  You are limited on the refresh rate in Excel to only check the data every one minute.  However, you can manually refresh this if you find that one minute refresh is too slow for you.  Also, we use the file read component in Grasshopper to read the data back from the CSV file back into Grasshopper.  Any data, that you save in Excel as a CSV file will work this way.  In the video I only demonstrate bringing back the original CSV file back but any CSV file would work, so if you did custom formulas in Excel you can export a CSV of that data (formulas won't come through in the CSV which is a good thing only the data) back into Grasshopper.  

Also, we use the Format method to modify the string before exporting to Excel.  You can find out a bit more about string formatting on Microsoft's .Net Reference for String Format Method.

P.S. I really wanted to call this video "Grasshopper to Excel and Back Again: a BITs Journey" but I thought that might just be too nerdy and silly.

//Format Code Option 1
Format("x = {0:0.00} y = {1:0.00} z = {2:0.00}", x.x, x.y, x.z)
//Format Code Option 2
Format("{0:0.00}, {1:0.00}, {2:0.00}", x.x, x.y, x.z)

Rating

Please rate this tutorial below. Thanks.

5
Average: 5 (5 votes)

Comments

It's really helpful ! Thank u !

Want to Contribute?

Want to be an author? Drop us a line here we'd love to have you.

Already have a video you'd like to post? Send us a link and we'll get you going.

:)