Hi @eirannejad, I was gonna wait before logging this, but since the Rhino 8 BETA is now out and the current GHPython component has been (arguably prematurely) removed/hidden: A major missing feature in the new script editor is the ability to run an IronPython component in GH_Component SDK Mode:
I’ve come to rely on this quite extensively for e.g. drawing things, events, and performance. I do find the default code a wee bit bloaty and usually reduce it to a more terse version ala this:
And implement the same methods that the C# component has (e.g. for drawing, that may be inserted with a user-friendly button override):
And here’s a loose thought: It does, and kinda always has, feels a bit odd and convoluted to have both Procedural Script Mode and GH_Component SDK Mode. Perhaps this might be a good time to reevaluate whether it makes sense to consolidate the two modes? Perhaps remove the SDK bloat and make the design similar to the C# component, with a hard coded RunScript scope and user friendly options to insert draw overrides etc:
The override methods also might be renamed a bit for consistency. Currently some are named the same as the C# methods (e.g. DrawViewportMeshes) and some have PEP 8 names (e.g. get_ClippingBox, which is just ClippingBox in C#) and some use dunder/double underscores (e.g. __enter__, which is called BeforeRunScript in C# I believe). All quite confusing and visually unpleasing. It being IronPython/.NET I’d prefer using CamelCase names like the C# component.
There are probably many reasons why not to consolidate, but I thought I’d put it out there. For instance, procedural mode currently handles input and output parameters better I find. Where the method you input and return parameters by in SDK mode feels a bit weird, and the names of input/output parameters do not matter, only their order (which is not the case with the C# component). Anywho, brain dump over ![]()






