Link specific item in a list with a specific number

Hi
I’m working on gh def that contains a list of images linked with a “pulldown” component of Human UI plugin.
When I select an image from pulldown menu it compare in a view.
This is a list:
list
This is a relative dropdown menu from “Human UI” plugin:

I need to assign to each menu voice a specific number.
For example: i want to assign at menu voice “Anteriore Destra” the number 37 and at menu voice “SINISTRA DESTRA” the number 12, all when i click on this menu voice.
I want that this number appears in several “param” components.

Can you help me to understand how obtain this function?
Thank you

If it’s a flat list and the Text Strings you want your numbers “attached” to are unique, you can do this pretty straight forward with text matching:

Hope it helps, also see attached .gh file :slight_smile:
retrieve_from_list_via_pattern_matching.gh (10.6 KB)

Thank you so much @efestwin I’ll try to do it.
I’ve another question and I think that you could help me…
I’ve a problem with view a data in “param” component in Human UI Window.
I’ve a PARAM component in which it’s a value that derives from a dynamic measure taken with slider on a 3D objetc.
When i try to create a “Label” in Human UI in which insert this value I obtain this error:

1. In general, it’s not a good idea to drive the creation of
elements with the results of a value listener. Instead, use
the value listener to drive a “Set” operation, from the
UI Output tab, to update the contents of an existing element
in the window. Otherwise, every time something in the window
changes, triggering your value listener, the entire window needs
to be re-generated. This can create the appearance of a "freezing"
behavior. See the example files for more information on the appropriate
configuration of “Create” and “Set” components in Human UI.

This is a velue that I need to “render” in UI Windows:


This value depend from these sliders:


Can you help me to understand how can I resolve the problem?
Thank you

I have only used Human UI once before, so I’m not an expert here. But I interpret it like this:

  • what you are currently doing: Value from Param >> create Label
  • how it should be done ideally: create blank label >> Set value of label to value of param

There should be a component in Human UI that is called “Set” and sets value of a label or other object. But I’m doing this or if my head so no guarantee. I hope it’ll help anyway :slight_smile:

M.

1 Like