Insert a button into a document


Hello Forum,

I’d like to be able to insert a button into a document as if it was a geometric entity. Then I’d like to be able to run a plug-in command when the button is clikked. Is it possible?

Plan B. Can I define a side effect when the user selects an entity? If yes can I associate it to a plug-in command in order to achieve the target I mentioned?

Thanks. L

(Luis Fraguada) #2

Hello. Can you elaborate a bit more on what you want to do? When you say insert a button into a document, do you mean add a button to the Rhino interface, or create your own window or other user interface element?

You can certainly listen for different events in a plugin. Here is an article by @dale that discusses event watchers in C# using the RhinoCommon API. Here are some events that you can listen to, these include a SelectObjects event which fires when an object is selected. You could add an event handler in your plugin that listens for when an object is selected and do something with that info.



my purpuse is in fact to be able to open a form when the users selects a specific entity. Forget about buttons, they could do the same for my purpose but it would be over-complicated. The SelectObjects event should be enough. I’ll test it as soon as I can.

Thanks. L