Grasshopper

algorithmic modeling for Rhino

Hi everybody,

With a friend, we are trying to deal with the connection between excel and GH. 
We followed this tutorial on youtube: https://www.youtube.com/watch?v=7Cb4NuF2wcw
(thx Damien)

When we tried at home it worked with excel 2003. Unfortunatly, at my office we only have excel 2007 and we get the following result:

Error:  old format or the library type is not valide. (exception HRESULT: 0x80028018 (TYPE_E_INVDATAREAD)) (line:0)
(I tranlsated from french)

We tried to change :

xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")

by

xlApp = Marshal.GetActiveObject("Excel.Application")

But it doesn't work

It seems that it comes from the region setting and the language used by the software. This explanation was found on microsoft forum but we did not find the solution.

Does anybody has a clue to solve this problem but still in GH?

thx in advance


Views: 2140

Replies to This Discussion

hi suryansh

with the file parser i can only read but with the excel linkage i can build up a more interactive solution
sure if i only have to read data the file parser is the best solution (gsa data or ecotec..etc) but if i want to read and write it offers much more possibilities with excel or with the open office version from luis
Hmm.. I see. I haven't tried that script yet, but now that you mentioned about the interactivity, I am going to give it a try.

Thanks!
i want to read gps data! i've managed to get the coordinates (lat, long, ele) out of a kml file, but i'd like to read time into GH as well. can anyone one help with the vb script for this?

the code which gets me coodinates from my kml file (yay!) via the "read file" component (no useful time data available in this file):

Dim parts As String() = data.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)

Dim x As Double = Double.Parse(parts(1))
Dim y As Double = Double.Parse(parts(2))
Dim z As Double = Double.Parse(parts(3))

Return New On3dPoint(x, y, z)

the gpx file i would like to read (lat, long, ele, date/time) is attached (i need to generate a list of points, and times)
Attachments:
Hi Sarah,

I'm also trying to read GPS in GH...I'm fairly new to GH though, and am having trouble understanding the code in your post. Can you explain what you're doing, or upload a definition file? I'd greatly appreciate it!
Hi GrassHoppers,
would anybody tell me about the URL of Damien'blog?? I am looking for an article about Excel2GH at Demien's blog,but I just cannot find it. Thanks in advance.
Thank you Minh~~
i have the same problem encountered... is there anyone can provide the solution ?
I was trying to follow the video above but I can't read any of the code. I'm trying to understand all the ins and outs of getting data from GH into a workbook and then back into GH. Is it possible for someone to post a GHX definition where they used this vb script component in it so I can work it out from there?
If you look at the other Excel posts on the site, you'll see I posted one after it with all the code from the video. The code previous has a few lines that takes care of the COM connection to a running instance of excel. Beyond both of those snippets, its standard excel coding and there's plenty of resources out there on the web for that.
Thanks! I found a ghx file and some info on the LiquidTectomics page. I'm getting a handle on the excel scripting which is straight foward. What I'm having a problem with is finding out how to get data FROM to excel. This script seems to take values from excel and then put them out as an array. i need to grab data from the vb component, insert the array into the cells, manipulate thoose cells through excel code or via the user interface and then grap this information in rhino.
sorry that should read: getting data FROM a rhino array (in actuality a datatree, but I think this is really just an array) to an excel worksheet/range

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service