PreSelect an object in GetObject()

I’m trying to create a command like below. Before users select objects in GetObject(), I want to set one object selected to highlight one preferred objects.
I tried some methods in GetObject Class. But I cannot acheive what I want. What am I doing wrong?

  • select some objects by user

  • create some objects that are necessary for next step.

  • user selects one object from ones that are created in previous step.
    (Question) I want to set one object selected before user selects .

      var guid = doc.Objects.AddBrep(Surface);
      doc.Objects.Select(guid, true);
      doc.Views.Redraw();
    
      GetObject getBrepAction = new GetObject()
      var ref = new ObjRef(guid);
      getBrepAction.SetCommandPrompt("Select one object");
      getBrepAction.GeometryFilter = Rhino.DocObjects.ObjectType.Surface;
      getBrepAction.EnablePreSelect(true, true);
      getBrepAction.EnablePostSelect(true);
      getBrepAction.AlreadySelectedObjectSelect = false;
      getBrepAction.ChooseOneQuestion = true;
      getBrepAction.OneByOnePostSelect = true;
      getBrepAction.AcceptEnterWhenDone(true);
      getBrepAction.EnablePressEnterWhenDonePrompt(true);
      getBrepAction.AcceptUndo(true);
      getBrepAction.EnableUnselectObjectsOnExit(false);
    
      getBrepAction.Get();
      if (getBrepAction.CommandResult() == Result.Success)
      {
          ref = getBrepAction.Object(0);
      }

Hi @kbysknhr,

Can you point to Rhino command that works this way?

– Dale