Hello,
My plugin creates a number of objects and adds them to the rhino document. At some point the plugin asks the user to create a point by clicking on a point on any of the objects. I do that with the following code (I write in C++/CLI):
void CreatePointOnObject ( void )
{
RMA::Rhino::MRhinoGetObject^ objectSelector = gcnew RMA::Rhino::MRhinoGetObject();
objectSelector->SetCommandPrompt ( "Click on any object to create a point _" );
objectSelector->SetGeometryFilter (RMA::Rhino::IRhinoGetObject::GEOMETRY_TYPE_FILTER::any_object);
objectSelector->EnableSubObjectSelect ( False );
objectSelector->EnablePreSelect ( False );
objectSelector->EnablePostSelect ( True );
objectSelector->EnableDeselectAllBeforePostSelect ( True );
objectSelector->AcceptNothing ( False );
objectSelector->EnableChooseOneQuestion( False );
objectSelector->GetObjects ( 1, 1 );
if ( objectSelector->ObjectCount() > 0 )
{
RMA::Rhino::MRhinoObjRef^ selectedObjRef = objectSelector->Object(0);
RMA::OpenNURBS::On3dPoint^ p = gcnew RMA::OpenNURBS::On3dPoint();
selectedObjRef->SelectionPoint( p );
RMA::Rhino::RhUtil::RhinoApp()->ActiveDoc()->AddPointObject( p );
}
}
My problem is that when two objects coincide or are very close, a pop up appears which asks the user to select one of the candidate objects. This happens despite calling EnableChooseOneQuestion(False).
My question: Is there a way to supress this pop up and just select the first object in the list automatically?
As a work around (assuming I cannot do the above), I tried to group the objects. I noticed that when objects are grouped, they behave as one when you select them and drag them etc. However when I try to select the group with MRhinoGetObject, it treats them as separate objects. Is this a fixed behaviour, or I can make MRhinoGetObject treat them as one by setting a flag?
Many thanks
Odysseas