Hi all, I added this to a previous thread on this subject from August, but thought I’d better raise it as a separate post. In the latest Rhino Beta (8.0.23286.1003, 2023-10-13) and Grasshopper (1.0.0007 from Friday 13/10/23 ).
ghpythonlib.components methods are not accepting inputs in python
import ghpythonlib.components as ghcomp
import Rhino.Geometry as rg
move_vec = rg.Vector3d(10,3,5)
new_geom = rg.Sphere(rg.Point3d(0,0,0), 3.0)
geom_moved, transf = ghcomp.Move(geometry = new_geom, motion = move_vec)
Ghcomp is unhappy with either ordered args or named keyword inputs. So the code below doesn’t work either, which used to…
geom_moved, transf = ghcomp.Move( new_geom, move_vec)
The resulting error:
Traceback (most recent call last):
File "rhinocode:///grasshopper/1/cbaba2cd-c296-4f63-acb2-eeb5e81bcf39/f5a25331-884d-4b26-be9f-9040a0a1007c", line 11, in <module>
File "C:\Users\brian\.rhinocode\py39-rh8\site-rhinoghpython\ghpythonlib\components.py", line 163, in component_function
elif len(result) > 1: result = __namedtuple(outputnames, result)
File "C:\Users\brian\.rhinocode\py39-rh8\site-rhinoghpython\ghpythonlib\components.py", line 61, in __init__
raise TypeError(
TypeError: Expected type Array[str] for input 'attributes', got IReadOnlyList[String].
Is this something to do with the Ironpython implementation behind the scenes?
I realise I was being lazy making extensive use of the components library instead of rhinocommon, so if this doesn’t work in Rhino 8 I’'m looing at an extensive re-write of my code. The big shame would be to lose access to kangaroo components though.
Very grateful if anyone has any pointers or work arounds to this,
Cheers,
Brian