I have referencing Rhino Objects from the active rhino doc (with python) and I am not able to understand how to display them in GH. I am able to bake them back into Rhino. GH is also showing that I am properly referencing them.
I think this may have to do with setting the active document, but I am not sure. Attached is my Rhino File as well as my GH script which contains the python code.
I am interested in understanding how to do this with the
Grasshopper.Kernel.GH_Convert.ObjRefToGeometry technique as well as a a method not using the GH API.
import scriptcontext as sc
#rh_objs = sc.doc.Objects.FindByLayer(“ceilings”)
rh_objs = Rhino.RhinoDoc.ActiveDoc.Objects.FindByLayer(“foo”)
for obj in rh_objs:
refobj = Rhino.DocObjects.ObjRef(obj)
goo = Grasshopper.Kernel.GH_Convert.ObjRefToGeometry(refobj)
sc.doc = Rhino.RhinoDoc.ActiveDoc
a = rh_obj_list
sc.doc = ghdoc