Set display mode and background color using VB Rhino Script

Hi everyone, could anyone help me: how to write VB Rhico Script to set Rhino5.0 display mode to Rendered mode, the rendered mode’s background color to white? thank you very much.

Hi dale: thank you so much, my issue is done now.

Where is “Rhino.ViewDisplayModeEx” method in RhinoCommon ? I cant find it.


there is no ViewDisplayModeEx in RhinoCommon since it was implemented to support non standart display modes. You can use RhinoViewport.DisplayMode property instead and pass it a DisplayModeDescription. This you can find using the display mode name eg:

import Rhino
import scriptcontext
def SetDisplayMode():
    mode = "Rendered"
    desc = Rhino.Display.DisplayModeDescription.FindByName(mode)
    if desc: 
        scriptcontext.doc.Views.ActiveView.ActiveViewport.DisplayMode = desc