Change preview

Hi all,
is it possible to change the preview geometry from a script like the simple 3 buttons on the top right?
I’m working on a Human UI.

Thanks

preview geometry

preview mode

c# document preview mode.gh (1.6 KB)

  private void RunScript(int mode)
  {
    switch(mode){
      case 0: this.GrasshopperDocument.PreviewMode = GH_PreviewMode.Disabled; break;
      case 1: this.GrasshopperDocument.PreviewMode = GH_PreviewMode.Wireframe; break;
      case 2: this.GrasshopperDocument.PreviewMode = GH_PreviewMode.Shaded; break;
    }
  }
3 Likes