Hello,
I have been trying to do some highlighting and select synching in Rhino via my Modeltree, however i stumpled upon an issue that I cannot get the subobjects selected, only highlighted and thus also the Gumball never activates.
I made this quick tester, which is esentially what i am using. My guess is the SelectSubObjects doesnt really work as I am imagining it?
Using this script, the subobject does not get highlighted nor selected. How can i do that?
public override string EnglishName => "TestSelectBrepFace";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
ObjRef objRef;
var rc = RhinoGet.GetOneObject("Select a Brep or polysurface", false, ObjectType.Brep, out objRef);
if (rc != Result.Success || objRef == null)
return rc;
var rhObj = objRef.Object();
if (rhObj == null) return Result.Failure;
int faceIndex = 0;
rc = RhinoGet.GetInteger("Face index (0-based)", false, ref faceIndex);
if (rc != Result.Success) return rc;
var ci = new ComponentIndex(ComponentIndexType.BrepFace, faceIndex);
doc.Objects.UnselectAll();
// I thought this selects and higlights the subojbect.
rhObj.SelectSubObject(ci, true, true);
doc.Views.Redraw();
RhinoApp.WriteLine($"Selected BrepFace {faceIndex} on object {rhObj.Id}");
return Result.Success;
}
}