Picking + Gumballs in Grasshopper

Previously, I demonstrated how to directly pick points generated in a Grasshopper definition. In this example, we will add a Gumball so that we can manipulate those points. It is possible to do this using the Gumball option offered by Grasshopper, but you will have to internalize the data first (which means breaking some dependencies in the graph). This example was inspired by the gumball demo thread in the Grasshopper forum and David Rutten's example.


The definition is shown below. There are three parts: the first sub-graph contains a graph mapper and generates a list of points; the second sub-graph contains the custom Python component—PickGumball—that allows users to select and manipulate those points; and the third sub-graph generates a pipe through the manipulated points.  As shown in the above video, you can edit the graph mapper and the picked/manipulated points are 'remembered'. Like before the trick is to store those points in the sticky dictionary of the scriptcontext.

Pick Gumball Defintion

Pick Gumball Defintion

The script in PickGumball is based on the Add Gumball example from the McNeel wiki. As usual, the definition can be downloaded . You will need to have the GHPython component installed to open this definition.