Grasshopper

algorithmic modeling for Rhino

importing custom python classes into python grasshopper module

I have made a python class(FritClass.py) that I would like to import into a python revit module. I assume this is easy to do but don't see any questions on the forum as how to do this.

Any suggestions?

thanks.

Views: 3231

Replies to This Discussion

Sorry I meant I would like to import the class into a GRASSHOPPER python module. My bad. Must have had Revit on the brain.

I was wondering :)

Hi Jon,

  • I assume you want to import a .py file (module) into a Python scripting component scope, is it?
    If so, then please look at this discussion here.

  • Otherwise, you might want to write the class code inside the component?...
    And instantiate it from there? Then, you can also pass class definition and functions via wires (here) or using the shared sticky dictionary (sample here).

Hope this helps,

- Giulio
________________
giulio@mcneel.com

Thanks Giulio. The first discussion is exactly what I was looking for.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service