New counter

Hi all,

Try to make the counter component easier to use. Credits to @dsonntag


The new counter doesn’t need a timer to fire up. It stops counting at maximum count that you set.
Zh_DocumentCounter.ghx (42.5 KB)

Please help testing. If any problem, let me know.
Thanks.
Jia

1 Like

Very nice , it would be better if you add pause button and set min ms to 1 even the slider = 0

1 Like

you are right. Thank you for your advice.
Here is the fix.
Zh_DocumentCounter.ghx (46.2 KB)

1 Like

Another idea to make counting slow , for this i use remap numbers but it is better if your component have it.
for example if max = 200 with remap i set the new domain max to 10 , this make the animation slow and better in some cases

I guess you can increase “ms” to 2000 to slow down counting.

Yes but the step is 1 second, with remap the step will be for example 0.001 which make animation slow and smooth

To avoid the conflict between multiple timers, I have reverted to an updated version of the Python counter I posted before.

counter_2020Mar4a
counter_2020Mar4a.gh (7.9 KB)

Just two little problems observed so far…

  1. If you close the model and reopen it without quitting Rhino, the timers restart with their “sticky” values instead of zero.
  2. If you close Rhino without closing the GH model first, the following error message appears, apparently because the timer makes Rhino believe the GH model has changed.

What a mess!

Using timer itself make Grasshopper slow and C# better in counting than python

try to use “number smooth”. It may work sometime. Other else I don’t know how to make animation slower while smooth. Maybe use video editing software, many have function such adding extra mid frames.

Remap number :wink:

counter.gh (9.6 KB)

This is genius

Your report seem out of my knowledge. My method utilise document schedule to make counting; therefore, each document can only have one counter. I tried two counters simutiniously. Them shared one interval setting even though being given different “ms”.

That’s it :slight_smile:

n is the new maximum work exactly like remap number

counter.gh (7.4 KB)

1 Like

I wouldn’t count on the GUI Thread… As soon as you have some computation load the time does not work correctly anymore. Instead you can use System.Timers.Timer or the System.Threading.Timer or do the computation on a seperate thread for yourself.