Change Rhino Display from Grasshopper

Hi everyone,

I used to ahve this code to change the display view in rhino:

# Get Active view name'
view_name = sc.doc.Views.ActiveView.ActiveViewport.Name="Catalogue"

# Change Display Mode of the current view

Where View_Type = Wireframe

When updating to R8, I copied the code inside of the ironpython component and there is an error:


I am not getting what is wrong.

Can anyone take a look at that?

Thanks in advance

It looks like there might be some compatibility issues with Rhino 8. Here’s a simplified code snippet that should work for changing the display mode:

import Rhino
mode = Rhino.Display.DisplayModeDescription.FindByName("Ghosted")
view = Rhino.RhinoDoc.ActiveDoc.Views.Find("Perspective", False)
view.ActiveViewport.DisplayMode = mode
1 Like