Grasshopper

algorithmic modeling for Rhino

hello all,
I was wondering how I could tell a timer to increase a variable each set time interval by 1. the idea behind is that I want to have a list or tree, whose branches or positions grow by time. is anyone familiar with this?
thanks in advance

Views: 1230

Replies to This Discussion

Well, you could use theEngine from Grasshopper Tools in C#.

The output is a counter which you can use to drive other things (like exploding letters).

I used it because I couldn't figure out a way to use the GH timer to make an incremental counter, but I'm there may be a way, but it would be scripted.
taz,
thanks a lot! I added two input double variables, temp and xx. xx is a refresh-synchronized value from my wii controller, it updates every 50 ms. now I've tried to add all the incoming values to the former values. temp is set to 0 and should grow while the timer runs. since I didn't have any experiences with c#.net I changed the code like this:

//Set static variables
eventOn = isOn;
stopAge = (stopAt == 0 ? Int32.MaxValue : stopAt);

//Start timer
if(isOn && frameCount < stopAge){
timer.Start();

do {
temp = temp + xx;
System.Threading.Thread.Sleep(50);
}
while (frameCount < stopAge);


} else {
timer.Stop();
}

//Reset
if(reset != null){
frameCount = 0;
}

//Return value
C = temp;


but it doesn't work. do you have any ideas?
Sorry, C# isn't my department...

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service