Shortcut for Isocurve and Mesh Wireframe Display

I would like to set a shortcut to toggle the visibility of isocurves on and off with the “I” or “Ctrl+I” key, and the same for mesh wireframe visibility with “W” or “Ctrl+W”, but I do not know how to call these two commands other than through the Display checkboxes. What is the command that controls the visibility of isocurves and mesh wireframes?

not so straight forward as expected.

this seems to work, no warranty :slight_smile:

toggle for current viewport display mode

import Rhino
import scriptcontext

# Get the active viewport
view = scriptcontext.doc.Views.ActiveView
if not view:
    print("No active view.")
    exit()

viewport = view.ActiveViewport
display_mode = viewport.DisplayMode

if display_mode:
    # Get current isocurve visibility
    current = display_mode.DisplayAttributes.ShowIsoCurves
    # Toggle it
    display_mode.DisplayAttributes.ShowIsoCurves = not current
    # Apply the changes
    Rhino.Display.DisplayModeDescription.UpdateDisplayMode(display_mode)
    # Redraw the view
    scriptcontext.doc.Views.Redraw()
    print("Toggled isocurves in {}".format(display_mode.EnglishName))
else:
    print("No display mode found.")   

btw.:
there is a setting I was not familiar with:

“show for flat faces”

make sure this is on to see isocurves on flat objects.

Thanks :+1: