This video demonstrates how to make an incremental counter by assigning names of +1 and -1 to meshes and using the Track clicks component and a data recorder to sum these values over time. The guide below illustrates how to assign other names to meshes for other functionality.
The grasshopper file created in the video is attached.
Custom names for Meshes
You can use Fologram for Grasshopper to turn any object in your model into an interactive button in mixed reality by tracking a users clicks and checking to see if the clicked object name matches the name of a target object. Buttons can be used as counters to iterate through lists (e.g. previewing changing contours as in the video above), to create toggles (e.g. to toggle geometry on and off or flip a model), transform models and just about anything else you can think of.
Sending Meshes with Names
Reference the geometry that you wish to make a button into the Mesh input of the Fologram Send Meshes component. Set the Name parameter for the button to something that that describes it's function - we will use this later to determine whether a user has clicked on this button or something else in your scene. Make sure you also set the Interactive parameter to True to detect clicks on the object.
Note that you can set multiple geometry and name inputs for with a single Send Meshes component - in the example above we are creating two buttons at once.
Next add a Track Clicks component to your definition and connect the Object output to a panel to view the name of any Clicked object. If the user clicks nothing the object will output Layer(Default). You can also set a filter on the Track Clicks component to only detect clicks on objects with specified names using the Name Filter input parameter.
Creating Button functionality
In this case we are going to make a counter that increases by one when a user clicks on the object with name 'next' and decreases by one when a user clicks on an object named 'previous'. We use a Member Index component to test whether the name of the clicked object matches the names of our buttons, and output the index of the button if possible. We then create a matching list of values corresponding to what we want our buttons to do, and select from this list using a List item component. Lastly, we record these values over time and sum the result to create the counter.
Note: we could replace the values -1 and 1 with incremental angles or displacements if we wanted to create buttons to rotate or move objects.
Next: Making simple filters with Buttons