Grasshopper

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

Views: 2117

Replies to This Discussion

Try this:

Attachments:

Thanks Panda,

I have edited in your code and made it work without the GH component.

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service