Problem with new C# script new editor - copy/pasted code doesn't work

I’m using these scripts by @Mahdiyar to toggle buttons or change slider values with the keyboard.

Grasshopper Rhino 8 WIP marks the scripts with the ‘old’ tag and I tried to copy paste the content of the old script into a new C script editor.

It doesn’t work and I don’t know what I need to change.

Can anyone help me with this please? (14.8 KB)

It seems copy-pasting doesn’t work very well in v8, I’ll log this. Does the attached do what it needs? (28.6 KB)

This works as expected, thank you.

What I ended up doing is opening the script component in V7, copy there, and paste it into the the v8 script component you made.
RH-75936 copy and pasting code from old to new script component doesn’t work

1 Like

In some situations input lists aren’t recognised as lists and parameters need to be assigned in a V8 script which wasn’t required in V7.

I’m pretty good at copy pasting content of a script and Bing AI helped me fix some of the errors.

I’m not following what you mean here. Do you have an example?

I’ll post a file the next time I come across an error…

1 Like

Not sure if this is what Martin means but in my testing null values in a legacy script component won’t throw a value error but in the new scripting components they will if the inputs are null.

As example something simple like:

if x:
…“do this”

If you don’t have x input hooked up, it will throw a value error saying that x is not defined and in legacy script component it will simply realize x is null and therefore it would return the script in this example.

Legacy IronPython2 code copied into a new IronPython2 script component will do this as well as Python3, making me think it’s the script component itself and not the Python version?

1 Like

That’s one of the errors.

Here’s another one from a definition which runs fine in Rhino 7: (19.7 KB)

And another one with the following error message:

  1. Failed to get instance from script
    Exception: Compile Error
    ‘IEnumerable’ does not contain a definition for ‘Count’ and no accessible extension method ‘Count’ accepting a first argument of type ‘IEnumerable’ could be found (are you missing a using directive or an assembly reference?) (Error CS1061) rhinocode:///grasshopper/1/b7fd9d00-6dd3-420f-9382-b6bafb558dfc/e9461b65-3bc4-4356-ab94-48dfee8b17b1:[87:47] (18.2 KB)

One more: (11.2 KB)

I had to create a new list and add the points from the PC input to my new list to make the error go away.

Hi Gijs, these scripts you modified worked a few weeks ago but now fail again.

thanks @martinsiegrist
RH-76726 System.Windows.Forms is missing



Hi @Gijs another feature or bug in new script componet and old c# components in Rhino8wip that we able in Rhino 7 zoom in and zoom out in script screen component by Ctrl + Middle mouse button reel
But in Rhino wip grasshopper unable!
Please resolve it!

And if we create cluster from new script componet in rhino8wip Can’t create icon for it (icon is fix C#)

RH-76726 is fixed in the latest WIP

1 Like