algorithmic modeling for Rhino
Hi guys,
I'm trying to write a python function that imports a .obj file into grasshopper. This is so far I have gotten:
def importObj(fileName):
 
      import scriptcontext as sc
      import rhinoscriptsyntax as rs
      import Rhino as rc
      sc.doc = rc.RhinoDoc.ActiveDoc
      commandString = "_-Import " + fileName + " _Enter _Enter"
      echo = False
      done = rs.Command(commandString, echo)
      sc.doc = ghdoc
My problem is that this only imports the geometry into Rhino, how do I get it into GH?
Thnaks,
Christian
Tags:
 py_read_obj.gh, 40 KB
 py_read_obj.gh, 40 KB                             test.obj, 437 KB
 test.obj, 437 KB                            Thanks Panda,
I have edited in your code and made it work without the GH component.
 py_read_obj1.gh, 37 KB
 py_read_obj1.gh, 37 KB                            Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
    © 2025               Created by Scott Davidson.             
    Powered by
    