How to create a Rhino active menu


#1

Rhino menu.jpg

HI.
Is there a c++ SDK function used to creat a active rhino menu just like this?


#2

What I’ve done in the past is actually insert geometry into the scene where I expect people to click. I override the ShortName function to determine what shows in the list. You can also have it not draw the geometry unless highlighted, if that’s helpful.

You might also want to look at RhinoChooseOneObject


#3

Thanks.


#4

I see the RhinoChooseOneObject function.
but don’t know how to use it.
can you give me some examples.?
thanks again


(Dale Fugier) #5

The RhinoChooseOneObject() function is used by a CRhinoGetObject object picker when it determines that the user has picked on more than object. So in most cases, there is no reason to call this function on your own, as other SDK tools call this on your behalf.

The RhinoChooseOneObject() function is well documented in rhinoSdkGetObject.h. What issue with it are you having? What are you trying to do and why?

Thanks,

– Dale


#6

HI,dale.
thanks for you answer.
I think maybe RhinoChooseOneObject function is not my need.
I just want to chose the edge of surface,but one edge maybe belong to many surface.
so I need a pop menu to chose which surface the edge belongs to
just like the screenshots I provided in the first article of the topic.


(Dale Fugier) #7

CRhinoGetObject will do this for you automatically.


#8

but I have’t saw CRhinoGetObject do this for me automatically.
I think maybe I should set some params?
but I don’t konw which params I should set ?


(Dale Fugier) #9

How about this:

CRhinoGetObject get;
get.SetCommandPrompt( L"Select edge" );
get.SetGeometryFilter( CRhinoGetObject::curve_object );
get.SetGeometryAttributeFilter( CRhinoGetObject::edge_curve );
CRhinoGet::result res = get.GetObjects( 1, 1 );

#10

dale:
my codes are just like you provided.
but when the edge selected belongs to two faces,
the select menu still does’t not appear.