When using sub-object selection on a block instance, the ObjRef.SelectionPoint() location is relative to the instance at its identity matrix transformation. Running the following script on SelectionPoint.3dm (30.8 KB)
with and without sub-object selection demonstrates this. Is this intentional?
import Rhino
import scriptcontext as sc
def main():
go = Rhino.Input.Custom.GetObject()
go.OneByOnePostSelect = True
go.Get()
if go.CommandResult() != Rhino.Commands.Result.Success: return
sc.doc.Objects.AddPoint(go.Object(0).SelectionPoint())
sc.doc.Views.Redraw()
if __name__ == '__main__': main()
The selection point should always be on what you pick. That can be either somewhere on a top-level object or on a sub-object in a block instance. The selection point will not be transformed to an equivalent location on the block definition geometry.
Perhaps I need more information on what you are seeing?
Without sub-object selection, the point is at the actual pick point.
With sub-object selection, picking the object results in a point location per the block definition (non-transformed block instance). In the image below, when picking at the green point, the SelectionPoint() location is at the red point.
I don’t think this should be the case because the transformation of the point doesn’t match that of go.Object(0).Geometry() .