Grasshopper

algorithmic modeling for Rhino

I'm currently developing up an interoperation between GH+ECO and was wondering if anyone has developed in a more sophisticated way than via excel as I'm looking to get a full loop connection between the two, including project information, materials, etc.

I'm looking at embedding Ecotect information within VB (or possibly C#) components and was looking for the most efficient connection.

It looks like I have 2 main options:
1. XML database-centric model of which both GH + ECO write to the XML document.
2. LUA scripting from within GH and ECO.

XML would be the first choice as it seeks to contain data purely outside of both apps, however, the redundant code that ECO needs to read / write gbXML files may be a headache to script the content.

Another question I had was to whether I can populate data (such as weather, location, materials, etc) directly from the Ecotect libraries (.lib) to feed into the GH components or would I need to decompile these first.

Views: 1849

Replies to This Discussion

Hello Dirk,
While I cannot not reply on all subjects, it seems .wea files would need to be converted into .csv (in their case Column Separated Values) in order to be read by simple File methods. I have not looked into LUA too much, but it seems fairly straightforward...
Luis
Luis thanks - it's good to know when I need to start loading up the file.

XML seems to be working fairly well now, however, the gbXML export strips out information (weather data, etc) - a custom LUA script will have to be written to I/O to get the proper structure.

If anyone else is interested, there's a really helpful template on VB XML writing / reading here and calling the Ecotect environment here.

There's basically no community when it comes to scripting in Ecotect so it's a little slow crawing through the LUA environment.
I'll through in my 2 cents here, since I've been contemplating a connection to Ecotect but haven't had the time to really fully investigate it...

I think that XML is a good way to get that nongeometric data back and forth between applications. Although its tempting to try and do this via gbXML files, IMHO if you're writing the code its almost more worth it to just figure out an XML structure yourself. The main reason being that gbXML is a fairly big beast, and invariably you'll have information that you might want to transfer that won't necessarily be able to be contained within the gbXML schema, so you might wind up having to add your own tags anyway. Plus, if you're going to have to worry about parsing the xml yourself, it will be easier to do so with your own tags and much leaner as well.

In regards to using LUA from GH, I'm not sure if there's any potential to write LUA directly in GH (it would be nice though). There is a project out there for a LUA implementation with the dotNET framework, but I don't know if it would be able to be used from within GH or Ecotect. I would think that it would be possible to code up some sort of dll that would be able to talk contain function calls between VB.NET and LUA.

I took a look at a cached version of the LUA/VB thread you posted (a live version didn't come up), and only being able to use existing scripts through COM is a definite limitation. It might be better to use ecotect as a base instead of Rhinoscript, simply because you can have more access to Rhino through COM. Unfortunately though that would specifically limit you to only dealing with Rhinoscript as opposed to GH. Although, you could still do quite a bit with referenced geometry into GH. Note that there is way to replace geometry, so you would be able to keep any GUID references that you have in rhinoscript even if the geometry was changed through GH.

On a side note, I wish that Ecotect would add scripting support for other languages, specifically Python. I'm not sure what the rationale was behind LUA, but considering Ecotect's whole basis is working with geometry from other applications, it would be a good idea to take that into consideration with scripting languages as well.

Best,
Damien
Damien, thanks for the ideas. I've got the whole setup running now - it was pretty easy getting the XML file written from within GH. To get the framework, I exported from Ecotect and just built the structure exactly, including materials, zones, building types, and most importantly geometry - you actually don't need the entire gbXML data for Ecotect to inteprete the file.

The big problem I now face is from Ecotect's end - it won't allow for a silent import of XML data as there is a dialog that requires a user click, this may(?) be overcome with a VB mouseclick call and window focus back onto GH but it's still a limitation to importing XML.

So I'm thinking I may have to write a GH to LUA conversion script which builds LUA scripts, saves the scripts and then calls up Ecotect script manager to execute... sounds cumbersome but may be the only way for the time being.

It would be great if anyone has any code that sends commands to already running (background) applications as I haven't completely sorted this out so far...
Hi Dirk.

I am trying to connect grasshopper with ecotect as well. I have come to point where i read excel data generated by ecotect in GH and then adjust my geometry accordingly. Then again I export model to ecotect etc. etc.

But if I understand it properly, you managed to connect these two pieces of software kind of lifetime. ( no need for involving excel ) So you can see results of analysis right in GH? Generative components are capable of this ( http://www.mit.edu/~kkdb/newhome/generative/index.html ) , but since I don`t have the appropriate version of it and I like GH much better I am very interested in your method. Would you please be so kind and explain how you do that? It would be very useful for my work. Thank you in advance

have a nice time, Eduard

RSS

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