algorithmic modeling for Rhino
I made a c# assembly in visual studio that will take in a list of numbers and check if its even or odd. Im getting this error when i input numbers in grasshopper.
Here is my solve instance :
protected override void SolveInstance(IGH_DataAccess DA)
{
List<int> nos = new List<int>();
List<string> outp = new List<string>();
string ans=null;
DA.GetDataList(0, nos);
for (int i = 0; i < nos.Count; i++)
{
if (nos[i] % 2 == 0)
{
ans = "Even";
outp.Add(ans);
}
else
{
ans = "Odd";
outp.Add(ans);
}
}
DA.SetDataList(0, outp);
}
Tags:
Hey...
could it be that u are setting up a number-parameter instead of a integer-parameter inside RegisterInputParams(...)?
Greets
mark
Oh...Right. Thanks.
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