Grasshopper

algorithmic modeling for Rhino

Grasshopper to Excel, Read, Write, Chart

I have posted a download for a series of beta grasshopper functions which allow for live interaction with excel.

You can find the file at:  http://neoarchaic.net/2011/01/gh-excel-suite/

 

I hope you enjoy, find it useful, and look forward to any feedback, suggestions

Brief:

The toolset contained below allows the user to stream formatted data to and from open microsoft excel spreadsheet. There are three basic tool types, write to excel tools, which stream lists and tables to an open excel sheet live, read excel tools, which read specified regions of an open excel sheet, and a chart function, which produces and excel chart with customizable grasshopper driven formatting.


The attempt is to create an option to very simply stream data and at the same time provide wide access to a series of embedded formatting parameters to make the link between the two platforms more productive… and prettier.


THE READ AND WRITE TOOLS HAVE BEEN ALPHA TESTED FOR ARE COMPATIBLE WITH EXCEL 2003+

THE CHART TOOL HAS BEEN ALPHA TESTED FOR AND IS COMPATIBLE WITH EXCEL 2007+


Write to Excel Tools:

The excel output tools allow you to live stream any text based data out to an active excel spreadsheet. There are two primary output types, "List to XL", which will output a either a single column or row of information to excel, and "Table to XL" which will output a two dimensional array (Datatree in GH, Table/ Database in Excel).


Each tool has two versions. An advanced option allows the user to stream various formatting parameters, to better visualize the data being output. This includes options like cell color, which could be coordinated to a model/ rendering, for easy reference. Each of these formatting inputs are optional, and if left empty, will simply use the excel sheets default. The second component is the light version, which only outputs the data. There is no difference between the light version and the advanced version with non of the optional formatting used, it just takes up less space in Grasshopper.

Additionally there are 4 optional components, compatible with both the table and list tools, which allow the used to create varied formatting per cell/ per sheet. These require coordinated data tree structures with the data being streamed, (same as any other Grasshopper component).


Read from Excel Tools:

These two excel input function has user defined ranges of information from excel and returns the values as strings into Grasshopper. There are two types, the "List From XL" which returns a Grasshopper List of information, and the second "Table From XL" which returns a Datatree (2d array) of information. Both have similar structures that have an origin cell from which the function begins reading, for the list component there is an option to choose whether a column of information is read (from origin down) or a row (from origin right). Both allow the user to specify a limit or bound to how much data will be read, if not used, the function will read till it hits its first null entry for the list, and first null column entry for the table. Use of the "Count" and "Bound" inputs allow the user to bring null information into grasshopper.


Chart from Excel/ Grasshopper:

The excel output chart tool takes either a user defined pair of two dimensional points or an grasshopper excel tool output, which defines the 2d range for a set of data to be measured, then converts this data into a standard excel chart. This is a relatively new function, and may be a little buggy. Like the preceding output functions the inputs formatting are optional.

Be sure to uncheck the "_stream" function once a satisfactory chart has been produced or a new chart will be made for every change made in grasshopper which precedes the function.


THIS COMPONENT CURRENTLY ONLY WORKS IN EXCEL 2007+


Further Revisions to this component will be made, and functionality relative to actively changing an existing table, rather than constructing a new table each time will be added soon.

All suggestion for different versions, alterations, etc welcome.

Views: 5137

Comment

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

Comment by David Mans on January 7, 2011 at 7:29pm

UPDATE:

 I have posted an update to the file "GH-Excel_v0-02" which adds a bit of new functionality and fixes a few errors.

The new update to the GH-Excel Suite includes 

-correction to the "area" chart type which was conflicting with the color/ fill inputs foro data points.

- addition of new graph component Excel Chart (update) which allows for the active updating of an existing chart.  It uses the "Title" input to name the chart, then checks the active worksheet of excel to see a chart with this name exists.  If so, then it updates this existing chart rather than producing a new chart every time.  If there is no chart with than name, it will create a new one.  The old chart type is still there, in the event you simply want to make multiple charts. The component outputs a string (A) which tells you where the component has updated or created a new chart.  Additionally, it is recommended that you not use a "stream to excel" function with formatting when actively updating a chart, as this will drastically reduce the refresh rate of your chart.  I have found using the basic stream data with a fully formatted has made updating almost instant.

PLEASE post a comment if you find any bugs, I am continuing to try all combinations to check for conflicts. 

Comment by David Mans on January 7, 2011 at 2:30pm

Yes, i currently use it in excel 2007.

Let me know if you come across any issues.

Comment by paloma on January 7, 2011 at 2:28pm
I have a really dumb question but I need to be shore:

The instructions says that the read an write tools only works in EXCEL 2003+, that means that It should work with EXCEL 2003 and newest versions, or only with 2003?


Thanks for your work and patience
Comment by David Mans on January 4, 2011 at 11:57am
Thank you, didnt notice it had kept its formatting when I pasted it in there.
Comment by Bob McNeel on January 4, 2011 at 11:51am
Sorry... I had to change the text format so that I could read it. I'm too blind for tiny print.
Comment by Andres Gonzalez on January 4, 2011 at 9:20am
Thanks a lot, this is very nice.

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service