Grasshopper

algorithmic modeling for Rhino

Difficult interface GH and class-based python scripting

Hello,

I encountered a problem when using Python and GH together. Basically I'm doing a class-based script, with 4 classes working together, saved in different files to keep everything well seperated.

I edit them in the Rhino-Python editor (because I can acces several files at the same time there), and then test it by running the Master-file in a Python-box in GH. I use GH because it allows me to see the process real-time (it's time-based, I use the GH-timer), and to change the parameters really fast.

However, if I edit any scriptfile (except the master), GH won't recognise the change. I need to restart Rhino before GH will reload the scripts related to the Master and run correctly.

It's not making my life impossible, but it's a nuisance. Can I get around this?

The "Reset script engine" in the RhinoPython-editor seems to have an effect, but then the GH-box gives a fault because, for some reason, it can't load some other modules I'm using anymore...

Grtz,

Seb

Views: 477

Replies to This Discussion

Hi Sebastiaan,

the usual Python way would be to usethe reload() function.

http://docs.python.org/library/functions.html#reload

I hope this helps,

- Giulio
________________
giulio@mcneel.com

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