How to create a command for Toggle PointsOnOff in a single key?

My right hand is always holding the mouse. F10 and F11 are too far away from my left hand.
I’m using F5 to _PointsOn and I was using F4 to _PointsOff.

In Rhino7 F4 is used for '_SubDDisplayToggle

I wish to transform F5 to toggle on and off in one key.
Is this possible?
Can you help me to make this kind of command?

Hello - on a button you can use something like this:

! _-RunPythonScript (
import rhinoscriptsyntax as rs
def toggle_control_points():
    ids = rs.GetObjects("Select objects", preselect=True)
    if not ids: return
    for id in ids:
        if rs.ObjectGripsOn(id):
            rs.EnableObjectGrips(id, False)
            rs.EnableObjectGrips(id, True)


But for a keyboard shortcut or alias you’ll need to point it at an external py file like the one attached

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes" (384 Bytes)


Why go to the effort of a Python script when a simple keyboard macro does the job?

! _PointsOn
! _PointsOff

Ah, he wants a single key that works like a toggle.

1 Like