public Control CreateEditorControl(Action<string> helpCallback)
if (m_py == null) return null;
var control = m_py.CreateTextEditorControl("", helpCallback);
return control; //error comes up at this 'control'
I wanted to build it to use it as a training while figuring out how it all works. Later on I want to add additional DLLs so I can call them from python without clr. I am not sure if this is the appropriate way, but I’ll try.
yes, as it stands, you can build the GhPython source for V5 into V6 with that change. V6 looks explicitly for the new version, so you will have to bypass that (just rename the project and create new IDs and you will be good to go). Now GhPython is part of Grasshopper, and is bundled there in the same way. We no longer publish its source code for that reason. This obsolete source code is just kept there as a record.
The main changes introduced in V6 regard the editor, which is a facility which Rhino itself provides, the addition of the advanced scripting mode, the compilation of GHPYs, the iteration support (slightly faster iterations in V6). There’s also a change in the results of clicking the “Test” button: in V5 it used to keep all previous variables; in V6, user-defined variables are cleared. And a few more bug fixes and type supports (Guids, Planes etc).
I do not fully understand this question. You can compile a new GhPython (that you should call differently, let’s say “GhCobra” with another GUID). I do not really see many advantages in doing this, though. It’s just older and buggier code.
You can do whatever you want if you change the source code. Directly after compiling nothing will work properly, though, because you will need to change 1. the name and 2. the ID of all components and of the assembly, as I already mentioned several times.
For this, just make a Grasshopper User Object with the normal GhPython component. It will remember whatever code is set at the moment you made the User Object (same for Hints and same for number of inputs, outputs, etc). You can set your own icon. Then you can just use that component from the tab.
This will likely follow McNeel’s decisions with Grasshopper 2.0. There is no incompatibility if you just change the name and the ID, as it’s essentially another add-on.