Disable Gumball

Hi,

Is there a way to disable the the gumball during on rhinoObject selectet by either turning off the gumball function or disabling the default gumball conduit programmatically?

cheers,
Jeremy

I found this in the documentation

https://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_ApplicationSettings_ModelAidSettings_AutoGumballEnabled.htm

You can use it like this to temporarily disable the gumball:

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
  bool wasEnabled = ModelAidSettings.AutoGumballEnabled;
  try
  {
    ModelAidSettings.AutoGumballEnabled = false;
        
    Result res = RhinoGet.GetOneObject("Select object", false, ObjectType.AnyObject, out var objRef);
    if (res != Result.Success)
      return res;

    doc.Objects.Select(objRef, false);
    doc.Views.Redraw();

    res = RhinoGet.GetOneObject("Select another object (no gumball!)", false, ObjectType.AnyObject, out objRef);
    if (res != Result.Success)
      return res;

    return Result.Success;

  }
  finally
  {
    ModelAidSettings.AutoGumballEnabled = wasEnabled;
  }
}

Awesome, thanks mate!