It is often useful to be able to dynamically generate user interfaces when an unknown number of buttons is required to suit a given application. In this example we use the Human UI plugin for grasshopper to obtain the Name property of a collection of models from Rhino, and then create a button with a texture for each object to toggle the display on and off.
Assigning and Accessing Names
You can assign names to Rhino objects using the Name field in the Rhino Properties panel. Simple select your object, open the properties panel, input a desired name and hit enter. We use the Human UI Object Attributes component to retrieve this property within Grasshopper.
Creating Textures for Buttons
We have created a user object in Fologram that dynamically creates texture files with icons for neat buttons. You can set the text of the button using the Text input, and even create custom icons with our Read Write Bitmap tool (attached). We create one mesh geometry for each button name and distribute the buttons with a consistent vertical spacing. These are then sent to the mixed reality device.
Filtering Objects By Name
We use the Track Clicks component to detect the names of any objects we have clicked on in the mixed reality experience, then use the Member Index component to find the corresponding index of the model from a matching list of geometries. We can then use a List Item component to filter the selected geometry from the list and send it to the mixed reality device.