Cannot select the object twice properly

Hello,
I encounter a problem in selecting the objects with two steps. First, I want to select on or more objects. Then select another one object. A simple code is below.

    CRhinoGetObject go;
    go.SetCommandPrompt(L"Select one or more Curves");
    go.GetObjects(1, 0);
    if (go.CommandResult() != CRhinoCommand::success)
        return go.CommandResult();
    CRhinoGetObject go0;
    go0.SetCommandPrompt(L"Select one Curve");
    go0.GetObjects(1, 1);
    if (go0.CommandResult() != CRhinoCommand::success)
        return go0.CommandResult();

However, if I selected more than one object firstly, this code run well. However, if only one object is selected in the first step, the second step cannot be executed.

I have tested many times and have no idea on this problem. Maybe it is a possible bug. Many thanks for any suggestion.

Check this out : (Rhino C++ API: CRhinoGetObject Class Reference)
You can use : go.SetGeometryFilter( CRhinoGetObject::curve_object );
to filter the geometries to curves only

Hi @Qingxiang,

Try this:

CRhinoGetObject go0;
go0.SetCommandPrompt(L"Select one or more curves");
go0.SetGeometryFilter(CRhinoGetObject::curve_object);
go0.EnableSubObjectSelect(FALSE);
go0.GetObjects(1, 0);
if (go0.CommandResult() != CRhinoCommand::success)
  return go0.CommandResult();

CRhinoGetObject go1;
go1.SetCommandPrompt(L"Select one curve");
go1.SetGeometryFilter(CRhinoGetObject::curve_object);
go1.EnableSubObjectSelect(FALSE);
go1.EnablePreSelect(FALSE);
go1.EnableDeselectAllBeforePostSelect(false);
go1.GetObjects(1, 1);
if (go1.CommandResult() != CRhinoCommand::success)
  return go1.CommandResult();

// TODO...

– Dale

@dale @farouk.serragedine Thanks for your help. My problem is solved.