Grasshopper

algorithmic modeling for Rhino

Timers and theEngine script - Iterate integer, draw forms, bake: repeat

Currently I have a setup where I have TheEngine at the beginning of my script to interate an integer.  The integer feeds into an offset distance of a curve on a surface.  That curve then has customized shapes created along its length via a revolve surface.  That resolve surface is then input into a bake vb block.

Currently I have to set TheEngine block to around a 20 second pause between interations because at the end of its iterations (when the integer gets big), it offset and revolving takes quite a while, but if it iterates before the revolves finishes it won't bake.  This ends up making this functino take quite a long time to complete even tho the initial couple dozen iterations only need like 5 seconds tops.  I've thought of maybe plugging an Engine into the engine to iterate the delay times so the delay time increments too.... but this seems like a sloppy solution at best that would take quite a bit of troubleshooting and skirt the real issue.

The way the timer component works should do something more like what I want, where the whole entire set will iterate as soon as the last bake component finishes, but I can't seem to figure out how the Timer component works and there is literally no documentation on it as best I can tell besides the tooltip.

Any suggestions? I'll upload a definition in a bit when I get back from this test.

Views: 2484

Replies to This Discussion

Hi Chris,

are you even just a little bit familiar with C# or Vb?
What you could do is listen to the SolutionComplete event and then start a new solution (I think I remember it was called like that) with due caution.

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Oh I'm pretty familiar with VB.net in so much as basic for/if/array/etc, but nothing to specific to Rhino. I've written parametric scripts to produce parking garages and curved, banked stadium seating; quite fun.

Any advice on a little more specifics on how to that? It sounds like what I need, but it seems that it would result in a a closed loop in the grasshopper canvas. I use a VB block to do my surface offset (in hindsight there's no reason to do that heh) then at the end of the operations on that offset curve i do to the bake. It automatically bakes when it gets an updated solution, but if seems that if I were to tie that end bake block back into the beginning vb block (in order to have the beginning block wait for completion) it would tell me I have a closed (ie possibly infinite) loop.

Thanks,
-Chris
Hi Chris,

here a component which, following the idea of a trampoline in some programming languages, will reiterate the definition after one solution is complete. It also keeps track of how many steps occurred so far.

Trampoline
trampoline.ghx

You can copy-paste the scripting component from this definition. Written in both C# and Vb.Net. Please read the scribbles with instructions. Also, please keep in mind that each bake will take up some space in your document.

I hope it is helpful.

- Giulio
________________________
giulio@mcneel.com
McNeel Europe, Barcelona
Attachments:

This is a little off-topic, but how did you change the icon of the Script components without creating a custom component?

A way is drag-and-dropping a 24x24 .png file on it.

Giulio
--
Giulio Piacentino
geometrydepth.com design technology transfer

Shockingly simple, good to know, thanks!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service