algorithmic modeling for Rhino

Hi all,


I have some python scripts that I made originally for rhinoceros(without grasshopper)

and would like to use those scripts in the ghpython component.


the best thing will be importing those scripts like


----in the ghpython component----

import rhinoscriptsyntax as rs

import test



----in the ghpython component----


while having a that looks like this.. in the same directory of the grasshopper file(.gh)--------

import rhinoscriptsyntax as rs


def addpoint():

rs.AddPoint((0.0,0.0,0.0)) in the same directory of the grasshopper file(.gh)--------


and seems to fail getting

Runtime error (ImportException): No module named test


my guess is my file positioning is wrong, but is it possible to do this?

sorry if this is already handled...


just in case, I'm using...

Rhino 64-bit(latest) v 5.0  (5.1.2011.825, 2011/08/25)

grasshopper v0.80050




Views: 1553

Replies to This Discussion

Hi Yasushi,

Yes it's possible but you need to add your directory to the search path manually.
This will hopefully be made simpler in the future.


import sys
if not my_path in sys.path:

import my_library


There is a bugtrack item about this here.

I hope this helps.

- Giulio

McNeel Europe

Hi Giulio,


Thanks for the fast reply!

from this tip I can start integrating my scripts right away! 






  • Add Photos
  • View All


  • Add Videos
  • View All

© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service