Hi Marc,

you're probably the first to bridge the Excel/Grasshopper gap,
congratulations.

The bidirectional thing is not possible using a Script components (at
least I think it isn't). In order to handle events you need to
instantiate class instances which are not garbage-collected after the
script function terminates. This could be done by using Static/Shared
members, but you'd still somehow have to write a method that functions
as the event handler. It is currently impossible to add functions to a
VB Script component, because all the code you write already ends up
inside a function.

Essentially, all you really need to do is call OnSolutionExpired() on
the component that reads Excel data, whenever an Excel event is
raised. This will cause the solution to recalculate that part which
has been potentially changed. However, you do not have access to the
components from within your script code, you'll need to make an actual
component for this, which in turn means you'll need to make a *.gha
file, which in turn means you need to write it using Visual Studio (or
some other dev-platform).

--
David Rutten
Robert McNeel & Associates


On Oct 17, 3:13 am, Marc Hoppermann <[EMAIL PROTECTED]> wrote:
> Made a first test of an Exel component (PointCoordinate Extraction)
> which works really well.
> As Grasshopper seems to rerun the code when a change in the logic is
> detected it even works live!!
>
> http://groups.google.com/group/grasshopper3d/web/grasshopperExcel.movhttp://shift-lab.blogspot.com/
>
> Creating a bidirectional component is a bit harder as one would have
> to write an event watcher for Excel to make the Excel-> grasshopper
> direction possible...
> Any ideas for that?
>
> Marc

Reply via email to