How to press Escape key in the script

Is there a “utility” command like “_Enter”, “Pause”, but for the escape key (e.g. “_Escape”). I’m trying to get this script to work, but in the last line “-NamedCplane” command still waits for input after the script runs and ideally it would exit (what happens when user presses Escape key).

If there’s another way to accomplish this, please let me know as well.

import rhinoscriptsyntax as rs

named_cplanes = rs.NamedCPlanes()
new_name = rs.ComboListBox(named_cplanes)
rs.Command("-NamedCplane Delete " + chr(34) + new_name + chr(34))

Just add an Enter to your command line.

rs.Command("-NamedCplane Delete " + chr(34) + new_name + chr(34) + " Enter")
1 Like

Fantastic, thank you DanBayn. I forgot about the space before “Enter” - it was adding it to the previous variable :sweat_smile:

1 Like