ShowProgressMeter doesn't show the progressmeter in Rhino 8

Hi all,

I’m trying to show progress with the following code:

RhinoApp.WriteLine(StatusBar.ShowProgressMeter(0, 100, "Calculating", true, true).ToString());
      var sum = 0;
      for (int i = 0; i < 1000000; i++)
      {
          sum += i;
          StatusBar.UpdateProgressMeter(i / 10000, true);
      }
      StatusBar.HideProgressMeter();

But i cannot see the progress meter. Anyone any idea how to fix this? Thanks!

Hi @jeroenvanlith,

This Python script seems to work:

#! python3
import Rhino
import scriptcontext as sc
import System

def test_progressbar():
    sn = sc.doc.RuntimeSerialNumber
    min = 0
    max = 100
    percent = False
    Rhino.UI.StatusBar.ShowProgressMeter(sn, min, max, "Starting", True, percent)
    for i in range(min, max + 1):
        Rhino.RhinoApp.Wait()
        System.Threading.Thread.Sleep(100)
        if i == 25:
            Rhino.UI.StatusBar.UpdateProgressMeter("Calculating", i, True)
        elif i == 50:
            Rhino.UI.StatusBar.UpdateProgressMeter("Processing", i, True)
        elif i == 75:
            Rhino.UI.StatusBar.UpdateProgressMeter("Finishing", i, True)
        else:
            Rhino.UI.StatusBar.UpdateProgressMeter(i, True)
    System.Threading.Thread.Sleep(1000)
    Rhino.UI.StatusBar.HideProgressMeter(sn)

if __name__ == "__main__":
    test_progressbar()

Perhaps you can gleam something from it?

– Dale

1 Like

Thank you Dale, I will have a look at it!