Grasshopper

algorithmic modeling for Rhino

Hello David,
Is there a general guide for the SDK changes from 0019 to 0043? For example

Grasshopper.Plugin.GH_InstanceServer.ActiveDefinition.NewSolution(True)

Is this now:
Grasshopper.GH_InstanceServer.RegenAll(True) to regenerate everything and
Grasshopper.GH_InstanceServer.RegenCanvas for the canvas?

Views: 282

Replies to This Discussion

You can now expire the single scripting component in which you are inputing the code, using owner.ExpireSolution(True)

- Giulio
in 0019 I had to use a timer to get the GH components to read changing values coming from a scripting component. Are you telling me that I can now expire that scripting component and take away the external timer? Any examples of this?
Luis,

calling NewSolution on the GH_Document class will only work if no solution is currently in progress, which is usually the case when code inside a Scripting component is running.

NewSolution(False) will compute only those bits and pieces which have changed since the last solution, NewSolution(True) will recompute the entire new solution (similar to pressing F5).


owner.ExpireSolution(False) will expire the script component that owns the running code AND all objects which depend (either directly or indirectly) on your script component.

owner.ExpireSolution(True) will do the same, but it will also cause the GH_Document to solve itself again after everything has been expired.


ExpireSolution() also only works well if there is currently no solution being solved. Hence, usually the only time when it is smart to call those functions from within a Script component, is when you are responding to custom system or timer events, but not when you are using a Grasshopper Timer object.

I myself only ever use ExpireSolution() after UI events, such as Slider drags, Gradient grip changes, persistent data changes etc.


You can make your own Timers inside a Scripting component, but you need to be comfortable with the behaviour of GH_Document if the results are going to make sense.

--
David Rutten
david@mcneel.com
Leusden, Holland
My query was similar to this, but a bit off the topic.

Can the GH_AutoSaveTrigger be used inside a script node to automate saving before the rest of the code inside is executed?

I am aware of the potential problems this could lead to (provided it works).. like if a bit of code puts GH in a perpetual 'while' loop or anything that manages to crash GH/Rhino everytime it runs, and the file is saved with it (due to the autosave in the VB node), there is no way to ever be able to recover that file again...

I'm asking out of curiosity just so as to know how to use it.
Hi is where a SDK out in the community for building your custom components...?
If so a link for downloading would be great...
Or is it possible to compile the VB C node ?

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