Grasshopper

algorithmic modeling for Rhino

How to make a VB script step through a for loop based on a time delay?

Any suggestions?

I need to slow down iterating for visual effect.

thx! 

Views: 1098

Replies to This Discussion

play with this (but it's C#)

best, Peter

Attachments:

Peter,

It is not clear to me how to use these, not that familiar with scripting. Do I convert my VB script to C# in these modules or do these modules work with external scripts?

Sorry, novice at this :)

Anton (*),

That's NOT a "generic" sleeper (what a description, he he) : it's just a very simple example. So you need to use Sleep/Delay within your VB script. I've used the delegate thingy to highlight the obvious advantages (broadcaster/subscriber blah blah).

Suggested reading:

From The Master of C# things: http://www.albahari.com/threading/part3.aspx

Simple: http://www.dotnetperls.com/backgroundworker

Oversimplifiedhttp://social.technet.microsoft.com/wiki/contents/articles/21177.vi...

(*) there's a dedicated GH C#/VB/Python Forum for script matters

best, Peter

added a second example

Attachments:

and a third

Attachments:

and a comparison

Attachments:

Peter, Thank you so much. I will try to decipher next weekend. Here is what I'm trying to work on. A dual color game of life simulator.

No a scripting guy but got a little of it going with a sample game of life VB script I found.

Attachments:

Peter, are you interested to take on the Conway life VB script as a small project? I would love to contract a small project to make it a module that takes the two states (A,B) in and advances iterations based on an external trigger. Optionally new states can be added to the existing states based on a trigger (or to existing states). I plan to build some stuff around such a core module.

Anton

Well ... in order to understand what this thing does ... I said to myself > covert VB into the right thing (In C# we trust, he he) > it took me 12.678 minutes to do it WITHOUT checking(*) any logic > but once the input is redirected properly (+ solver enabled(**)) > endless loop started > computer exploded > RAM melted > GPU fried > CPU fried > Armageddon.  

(*) big mistake N66

(**) big mistake N666

more soon (play it again Sam)

GH recovered the thing (and I've added the critical bit):

code is a bit odd, mind (for instance line 115: Something = Something; ????)

Wow,

I'm on business trips till Saturday. Can wait to play with it then. My problem has been that I would like to advance the iteration based on an external trigger or timing without re-initializing the state. I also like to add additional stateA or stateB fields into the state from an external trigger.

Anyhow, thanks so much. You have paypal?

Update:

1. Well...when I first opened that I spotted an inactive VB and said to myself: OK the active is the good and the other is the crap.

2. But ... er ... the "other" is written by Giulio P. Enough said.

3. So I've did the VB>C# thingy on the "other" > computer halts.

4. So I'm testing some weird things right now  (but appears that Giulio has already (obviously) addressed the main issue here).

5. Paypal: I'm not after money (but I like sardines: feel free to send some Lucas tins [the ones with the red pepper]).

PS: Still the 1M question remains: what does that thing? (and why?)

he he

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service