I’m also eagerly awaiting this issue to be resolved, because every time I come back to this topic, I’m dealing with terrible workarounds… I saw some activity from @eirannejad in another thread, so I hope we can resolve this issue soon.
In the meantime, here’s a little code that can be attached to a button. It will send “T” or whatever you set to Rhino Command Line, so you can exit the GH Player without typing the magic number
, but by pressing the button in the GUI.
(In GH Document Properties, “Keep open after command completes” must be set to OFF, otherwise you’ll get the entire Grasshopper Breakpoint series—this is for those who are just stumbling upon this issue and don’t know all the tricks yet.)
// Grasshopper Script Instance
#region Usings
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using Rhino;
using Rhino.Geometry;
using Grasshopper;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Data;
using Grasshopper.Kernel.Types;
#endregion
public class Script_Instance : GH_ScriptInstance
{
private static bool _prevSend = false;
private void RunScript(bool Send, ref object Msg)
{
if (Send && !_prevSend)
RhinoApp.SendKeystrokes("T", true);
_prevSend = Send;
Msg = null;
}
}