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?
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.
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!
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:
open the sample script you uploaded above
double click the GhPython component to open the editor
click the triangular “Run” button in the editor
you get the exception
add a line to the start of your script with an empty print('') statement
click the triangular run button again
exception goes away
Also try this:
open the sample script you uploaded above
double click the GhPython component to open the editor
click the triangular “Run” button in the editor
you get the exception
close the editor
right-click on the canvas and select Recompute
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).
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.