Whenever a geometry is added to Rhino document from ghpython component, “SelLast” command fails to catch it the first time it is ran. It just outputs: “SelLast selection set is empty.”
It gets caught only when “SelLast” command has been ran the second time.
What is causing this? I perfectly understand that ghpython targets Grasshopper document, however the fact that we can also add geometry to Rhino document, would mean that we should be able to select it with SelLast first call. Or am I wrong?
The issue does not exist with Rhino Python Editor, only with ghpython component on both Rhino 5 and Rhino 6, regardless of the fact if we switch from Grasshopper to Rhino document or not (sc.doc = Rhino.RhinoDoc.ActiveDoc, sc.doc = ghdoc)
Here is a short example.
Any help would be appreciated.
import rhinoscriptsyntax as rs import Rhino sph = Rhino.Geometry.Sphere(Rhino.Geometry.Point3d(0,0,0), 5) id = Rhino.RhinoDoc.ActiveDoc.Objects.AddSphere(sph)