How to extract programs and constructions

Ah I see - gotcha.

Yes it is definitely confusing with all the different python components and environments now. Happy to provide a little background if it is helpful:

  • Pre-Rhino 8 there was something call the GhPython component, which allowed you to write and execute python code using the IronPython interpreter. This is what all the existing Honeybee-components use.
  • Now, in Rhino-8, there is a new IronPython component, and a new Python3 component. But the ‘old’ GhPython component still exists - it is just ‘hidden’ by default though. So to access it you have to type #GhPython in Grasshopper to get access to it (note the ‘#’ symbol).
  • So while it is true you can import and use the LBT python libraries in the different editors (GhPyhon, IronPython, Python3), you cannot pass actual python ‘objects’ (in this case the ‘room’) between the different editors.
  • You can think of the different editors as existing independently and in parallel to one another. They don’t know about each other, and can’t really talk to one another well. While it is technically possible to pass some simple objects between them, it is complicated and not recommended.
  • So since the Honeybee-room is made in the ‘old’ GhPython one, you can not pass it to the ‘new’ Python3 one to pull out the program_type attribute. Since it was made in. GhPython, it has to stay in GhPython.

hope that helps!

@edpmay

6 Likes