Enable/Disable Shadows

Hi
How can shadows be enabled/disabled using scripting?

This works from inside a c# script:

 private void RunScript(bool x)
  {
    Guid id = this.RhinoDocument.Views.ActiveView.ActiveViewport.DisplayMode.DisplayAttributes.Id;
    //Guid id = Rhino.Display.DisplayModeDescription.RenderedId;
    Rhino.Display.DisplayModeDescription dmd = Rhino.Display.DisplayModeDescription.GetDisplayMode(id);
    dmd.DisplayAttributes.CastShadows = x;
    Rhino.Display.DisplayModeDescription.UpdateDisplayMode(dmd);
  }
1 Like

Thank you Riccardo @maje90

1 Like