Grasshopper

algorithmic modeling for Rhino

I am using ver 0.6.0012 C# components.
This newer version is very strict in casting types.

I have been fighting with "specified cast is not valid" error (without specifying which type to which type) for a while.
This was revealed to be caused by connecting Numberslider to Integer input. (Even if the Numberslider outputs integer, the type is double.)

Hope it would help someone in the same problem.

Views: 592

Replies to This Discussion

there was a dicussion about this earlier, it's a shitty problem i agree.
here it is: http://www.grasshopper3d.com/forum/topics/trouble-on-the-c-side?pag...

check tobias' answer:
"I had the same problem a while ago, my solution was to change the hint of the input list "x" from double to Object and then cast the items back to double like so: sum = sum + (double) x[j];"
Thanks.
Right. I commented everything out, when I realized the problem is in input.
My solution for this was to bypass the control value through integer component so that the hint for the type is unchanged.
Ooops sorry, the newer version works 0.6.0018

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service