algorithmic modeling for Rhino
Can you upload the gh file? and I can try test it.
Aroving,
It seems to be failing because you haven't imported System.Object so when you say
"outTree = DataTree[object]()" Python doesn't know what object is.
I got your code to work by putting 'from System import Object' in the top line of your script. Also note it's case sensitive so you'd need to change the 'object' in line 6 to 'Object'.
EDIT: Okay something very odd going on. It worked when I wrote it from scratch, however after I opened your script to check it worked in your function it started getting the __index__ error. In your script AND the one I wrote from scratch. The only way I could get it t work properly was to close grasshopper and rhino and open it again... Maybe there is something wrong with your file? What version of Python are you using - if not the latest I would update your python component.
hello McDonnell, sorry so late to reply your message. Thanks for your patience. But i still have a problem want to figure out. In outTree = DataTree[Object](), what does Object stands for? the input data type or the output data type??? I once used Object for a list and it works. so, can Object stands for all type?
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by