This works OK before compile in ghpython, but wrong after compile: global name “ghenv” is not defined.
How to add warning or error in ghpython after compile?
I don’t remember the specifics, (and I’m away from my work computer), but I ran into a similar issue when writing the components here:
Maybe take a look at the differences in the ghdoc declaration? I’m a little fuzzy, but I definately remember having to fix a similar issue between the procedural code version and the python compiled, (sdk) version.