Grasshopper

algorithmic modeling for Rhino

Dear All,

I was just wondering whether it's possible to create a GH component in Python, and if so any examples?

Many thanks

Views: 5032

Replies to This Discussion

Hi Omar,

No, currently it is not possible to create .gha files with python, and we are all hoping this will change as soon as possible.

But what you can do is create user object files (.ghuser).

Thanks Djordje,

But what is the difference?

I may not be the best person to answer this question.

.gha files are in fact .dlls. You can't open them nor change their code. You can call them from node-in-code feature.
User objects are basically C#,VB.NET,Python components (the ones you can find in the Math->Script tab).
You can open, edit them, and can't access through node-in-code feature.

many thanks Djordje

There is now a new tutorial on GhPython code compilation in McNeel discourse.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Djordje,

So I gather from your response that it is not possible to access lines of code of any of the user objects (Say LB + HB objects) that my grasshopper use from a python component on canvas. Is that correct?

Thanks,

Devang

Hi Devang,

I haven't checked if this is true for the newest Rhino WIP, but on Rhino 5 you can't access other Ladybug/Honeybee user objects from the ghpython component.
Mostapha started tackling this issue in the last release ("Rewriting Ladybug!" section):

http://www.grasshopper3d.com/group/ladybug/forum/topics/release-not...

by completely rewriting the Ladybug code:

https://github.com/ladybug-analysis-tools/ladybug

At the moment only few Ladybug components are supported.

EDIT: sorry for receiving two replies. For some reason my first one went berserk, and showed only the link.

Thanks for responding Djordje. I understand. This is serious OOP. Using dot notations will be so much fun.

Hi guys,

Are there any news on creating custom GH components in Python please? Any developents towards that at all?

Many thanks,

Miriam

Hi again Miriam,

yes - in the Rhino WIP you can find an implementation. Please note that this is a beta feature -- it might change or be removed in future versions of Rhino.

Thanks

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

This is great! Thanks a lot Giulio.

Miriam

Hi Giulio,

I've installed Rhino WIP, the latest version of GH and the latest GhPython component, which on Food4Rhino still is 0.6.0.3. Where can I find the Grasshopper Python Script Editor that I can see in your picture?

Many thanks in advance.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service