Pick points and lines drawn in a Conduit

Hi Stuart,

Rhino’s object picking support only extends to objects that are in the document. In other words, the Rhino SDK does not have pre-canned functions that you help you pick dynamically drawn geometry. That said, it is possible to simulate the picking of dynamic drawn geometry. Rhino 5’s Gumball object is a good example of this.

The first think you will need to do is maintain a list of the dynamically drawn geometry. Without one, there is no hope of ever knowing what you picked on.

The next think you will need to do is to construct a pick context (Rhino.Input.Custom.PickContext). Having one of these will provide whatever function you write, that does the actual picking, some useful information on where and how the user picked. I don’t find a lot of examples of using a pick context (because it is hard). But I do have an example of using a custom Gumball object that uses a pick context. Here is the sample of how to construct one:

https://github.com/dalefugier/SampleCsGumballCylinder/blob/master/SampleCsGumballCylinderGetPoint.cs

The real work is in your own picking function, where you get to interpret what is provided by the pick context and see if it hits any of your custom geometry.

Hope this points you in the right direction.

1 Like