GetObject not leaving the selected objects selected/highlighted

Hi All,

I need to enable 2 objects to be selected by the user. the first selected object to remain highlighted and the 2nd selected object to have the gumball enabled but not the first.

As I was experimenting to implement this the objects being selected are being unselected after exiting my code below.

could anyone advice me what is wrong in my code please?

public static Result getFirstAndSecondMembers(out RhinoObject first, out RhinoObject second)
	{
		first = second = null;
		var go = new GetObject();
		
		go.GeometryFilter = ObjectType.Extrusion;
		go.SetCommandPrompt("Select first and the second members");
		go.GetMultiple(2, -1);
		
		if (go.CommandResult() != Result.Success) return go.CommandResult();
		
		go.GroupSelect     = true;
		go.SubObjectSelect = false;
		go.EnableClearObjectsOnEntry(false);
		go.EnableUnselectObjectsOnExit(false);
		go.DeselectAllBeforePostSelect = false;
		
		var sobs = go.Objects();
		
		first = sobs[0].Object();
		second = sobs[1].Object();

		return Result.Success;
	}

Why not select the objects from code?

      // <snip existing code>

      first = sobs[0].Object();
      second = sobs[1].Object();

      // select the objects 
      first.Select(true);
      second.Select(true);

      // show gumball 
      ModelAidSettings.AutoGumballEnabled = true; 

Thanks Menno…

This is a newbie question :stuck_out_tongue:

dont know what i was doing there… so was trying diff things.

i didnt even know how to do enable/disable gumball

ModelAidSettings.AutoGumballEnabled = true;

i will try that and get back to you…

thanks once again!!

No worried, I hope my response did not make you feel like a newbie. Everyone has a learning curve :slightly_smiling_face: I only learned the gumball enable/disable a few months ago.

I can assure you Menno, I am still on liquid diet, still a baby Rhino :slight_smile:

all good mate. i am still working on something else and then will try out your suggestion.

thanks.

just tried your code, thanks, it works but the gumball covers both the selected object :frowning:

i only want the 2nd to be associated with the GB but it looks like thats how gumball was set to work that is to cover everything in the selection list but there must be a workaround for it?

thanks.

Yeah, I noticed that too. I could not find a workaround I’m afraid…

Thanks for trying at least :slight_smile: