I am trying to do some custom pick filtering using the PickContext class. I found the C++ sample that uses the CRhinoPickContext at:
In implementing this in C# I cannot find the equivalent of RhinoDoc.PickObjects to find the objects that takes the PickContext and finds all objects that intersects the pick frustum. Is there an equivalent in C#?
Thanks Tom. The gumball example does a good job of showing how to use the PickContext in RhinoCommon. What I still don’t follow is how you perform the object intersection testing once you’ve constructed the PickContext. The C++ sample has a doc.PickObjects method to retrieve the objects intersected by the PickContext. In the gumball example it looks like the PickContext is used to set the gumball dragging constraints. In my case I’ve set up the PickContext but can’t see how to perform the object hit testing, specifically to see what subobjects are intersected in a brep.
Hey Larry,
I was making some fixes to this function last week It is located on the document’s ObjectTable…
doc.Objects.PickObjects(pickcontext);
I’m not sure if my fixes made it into the WIP that you are currently using or if they are in the WIP that will be available tomorrow (guess you’ll know if the function crashes Rhino.)
I’ve installed the latest WIP version and the PickObjects method is there on the RhinoDoc class; in doing some testing on breps with many faces, I’ve set the SubObjectSelectionEnabled flag to true on the PickContext object, however when I call PickObjects I always get back the brep object I clicked on but none of its subobjects; I would have expected to get faces back in a shaded mode; is there something else I need to do to select brep faces using the PickContext?