The attached 3DM file contains two solids, two polylines, and four TextDots. The script uses the TextDot positions as the four viewport pick positions.
I am calling ObjectTable.PickObjects with otherwise identical PickContexts:
face 1andedge 1useSubObjectSelectionEnabled = Falseface 2andedge 2useSubObjectSelectionEnabled = True.
Script and test model
TestPickObjects.3dm (64.6 KB)
TestPickObjects.py (5.1 KB)
Expected selection after running the script
Actual selection after running the script
The SubObjectSelectionEnabled option works for the polyline: the returned component changes from InvalidType, -1 to PolycurveSegment, 2.
For the solid, both picks return Extrusion, InvalidType, -1, so the whole solid is selected in both cases instead of selecting the face.
The attached script and model reproduce this.
This appears to be a bug in subobject picking for solids.
Why do I need this?
I am building an integration testing framework that opens a _start.3dm file, runs Rhino command macros, saves the result, and compares it with an _expected.3dm file.
Some tested commands pause for object or subobject selections. For these cases I am developing a transparent SelObject command that can run while another command is active. It receives a 3D point, or finds a named TextDot in the test model, projects that point into the active viewport, and creates the corresponding selection. For example:
SelObject Object 10,20,30 select a solid by picking at 10,20,30
SelObject Object Dot "solid 1" select a solid by picking at the position
of the TextDot with text "solid 1"
SelObject SubObject Dot "face 2" select a solid face with a similar pick
The goal is to reproduce normal viewport selections from scripted tests without requiring a person to click.

