[BUG] GHPython component unable to process single item inputs?

Hi,

I’ve noticed in the latest Rhino 7 (7.2.21012.11002, 2021-01-12) for macOS that the Python component in Grasshopper is unable to process single item inputs?

As soon as I input a list of data, with the input still set to Item Access the error disappears!

Screenshot 2021-01-17 at 09.36.52

Could this be linked to the weird, new output messages that appear in the editor?

Does the first implicit Grasshopper cycle happen when the blank component is dropped on the canvas, and the second when code is run for the first time? Or how should this be understood?

Please fix this!! I depend on GHPython daily and now need to revert back to Rhino 6, until this is fixed.

Here’s my test file:
ghpython_test.gh (6.0 KB)

You may have to run/recompute the component manually first. On launch, the error sometimes doesn’t happen right away. This also applies to when inputs are changed!

Thanks.

bump

bump

I have noticed that if you run a GhPython script while the editor is open if the script doesn’t contain any print statements, you get this error: After Solution exception:Sequence contains no elements

In this case, if you check the outputs of your script - it is working.

Try this:

  1. open the sample script you uploaded above
  2. double click the GhPython component to open the editor
  3. click the triangular “Run” button in the editor
  4. you get the exception
  5. add a line to the start of your script with an empty print('') statement
  6. click the triangular run button again
  7. exception goes away

Also try this:

  1. open the sample script you uploaded above
  2. double click the GhPython component to open the editor
  3. click the triangular “Run” button in the editor
  4. you get the exception
  5. close the editor
  6. right-click on the canvas and select Recompute
  7. exception goes away

Definitely something here that needs to be fixed. It seems like while the editor is open if you don’t send anything to output it generates an exception (but the script still seems to function ok).

-Kevin

1 Like

Thanks for sharing your observations @kev.r! Something sure is wrong here.

Hi, looking into it right now. Thanks

1 Like

Could you explain this please!

This has been fixed and will be in service release 7.3. RH-62363.

When you have a collection of data as input and the parameter is set to ‘Item Access’ then your code gets run for each item in the collection and “First / New implicit Grasshopper cycle” gets printed for each cycle.

As mentioned above you can add a print statement to your script in the meantime as a workaround.

Thank you for reporting

1 Like

Thanks for the fast fix! :slight_smile:

RH-62363 is fixed in the latest Rhino 7 Service Release Candidate