Grasshopper & ghpythonlib

Hi guys, and happy holidays to all

I have a doubt when using the library of “ghpythonlib”

being that in grasshopper, there are component differences between different versions,
a file created with a new version, new components cannot be run in old versions.

I was wondering if the same thing happens with the aforementioned library?
in the sense, if the code of the ghpythonlib library is the same source code that the components use?
in this case, when the components of a new definition are opened with an old version and cannot be executed, the same thing happens if I write a code with the Python component using the ghpythonlib library?

no info about it?

Hi, my guess is it is just calling existing components that user has in GH. So if the user has old version of component, and he will be using this calling, then it will also use old version of component then. But that is just my guess, maybe @piac will be able to help to understand how it exactly works :wink:

That’s exactly the case. The module simply allows to call components that are in Grasshopper, there is nothing additional to remember where and how the function worked on other versions. Components are instantiated and evaluated on the fly. More info on usage at Node in Code from Python. with Python

1 Like

@w.radaczynski thanks for the directions

@piac thanks for the clarification.
so as I had assumed the code changes with each version of Gh, and obviously as happens with
the use of the components, with an old version it is not possible to use the codes of the new version.

ps so if I understand correctly inside the Gh components there is a code
that calls the routines of the “ghpythonlib” library to which they are linked.

Thank you very much :+1:

It’s a little more involved. ghpythonlib instantiates components in memory (without drawing them) and calls the solving routines in the in-memory instances.

:+1: