Display UserTexts of an object when clicking on it

Hi everybody,
I’m using a pretty big model as sort of a database in which I store my clients data in userTexts.
I have scripted some python code to display a group of usertext values in a text dot annotation, located at the center of the object.
Unfortunately, I can’t display a lot of data otherwise it will hide the object itself. Moreover, I have to delete the text dot object after reading it.
I’ve heard about text diisplay conduit that could be very interresting by mixing with the clicking object event.
When the option is activated, I’d like to display usertexts as a conduit on the corner of the window as long as an object is selected.
Has it been done before ? Any ideas or tips to start a script doing that ?
Thanks for your help.

Here is an example :

Hi @BaptisteC,

The Rhino WIP has a new user text panel. You might look into this as you might find it of some use.

It is possible to use display conduits (to custom draw stuff on the screen) and event watchers (to know when stuff is selected an unselected) using Python. Because Python scripts run and then end, you have to have a place to store these objects (display conduits, event watchers) so they are not thrown away when the script ends. Most people who are using display conduits and event watchers are storing them in the ‘sticky’ dictionary.

scriptcontext.sticky[key] = MyDisplayConduit

I don’t have any samples of either of using either of these features in Python. But I do for C#.


Not sure I’ve helped…

– Dale

1 Like

Thank you Dale,
I’ll have a look on this.