I’m using the RhinoDoc.SelectObjects event to apply some changes to the gumball of the selected object using the _GumballRelocate command. My goal is to transform an object using the gumball and keep the last gumball position/orientation. This worked fine for Rhino 7 but stopped working with Rhino 8 because the gumball is changed to it’s previous position after my command is done. Is there any way to suppress this behavior?
private void RhinoDoc_SelectObjects(object sender, RhinoObjectSelectionEventArgs e)
{
if (e.Selected)
{
if (e.RhinoObjects.Length == 3)
{
foreach (var groupIndex in e.RhinoObjects[0].GetGroupList())
{
var group = e.Document.Groups.FindIndex(groupIndex);
var userData = group.UserData.OfType< RhinoCommands.GumballUserData>();
if (userData.Count() == 1)
{
var plane = userData.First().Plane;
Rhino.RhinoApp.RunScript($"_GumballRelocate {plane.OriginX},{plane.OriginY},{plane.OriginZ} " +
$"{plane.XAxis.X + plane.OriginX},{plane.XAxis.Y + plane.OriginY},{plane.XAxis.Z + plane.OriginZ} " +
$"{plane.YAxis.X + plane.OriginX},{plane.YAxis.Y + plane.OriginY},{plane.YAxis.Z + plane.OriginZ}", false);
}
}
}
}
}