algorithmic modeling for Rhino
Hi All,
I'm trying to port a rhinoscript function that draws hexagon cells on a surface. the approach I took was to instantiate a list of polylines and I'm trying to add the polyline within a loop ,to the list.
The polyline is the return value from a function.
I get the error "cannot assign to 'Add' because it's a 'method group'.
Can anyone suggest a diferent way to do it or help me fixing the script?
Definition enclosed Many thanks in advance
Evert
Tags:
myC.Add = DrawHex(S, u, v, stp, dUspacing, dVspacing);
... is actually trying to assign the output of the DrawHex function as an "overload" to the add function*. Since A) a polyline isn't a function and B) you can't add a function to Add anyway, you see the error that you have. The Add method actually takes whatever you'd like to add as the argument, so the syntax would be like this... myC.Add(DrawHex(S, u, v, stp, dUspacing, dVspacing));
for(double t = 0; t <= 2 * Math.PI; stp++)
If you look very closely, the variable that your using to evaluate the loop is t, yet you're incrementing the variable stp. Therefore, t never changes from 0 and you have an infinite loop. If you change the incrementing statement to t += stp
then that will increment your variable by the step your looking for.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