Nested Arrays, Casting, Lists, Classes

Hi,
Good afternoon.

Could I get some assistance with the GH code and the exercise below?

  1. In the GH attached firstly, I am constantly getting an error that says " The name “a” does not exist in the current context - line 125". Could someone explain why I keep getting this error? It works once but then when I try to run it again the error appears.

  2. How could I add more attractors and repulsors to the code? Would it be possible to add different colors as well to display the intensity of attraction for each grid point ?

Thanks in advance for any help.
A3.gh (7.3 KB)

Need to internalize Point param?

A3_2019Oct27a

  1. Error (CS0136): A local variable named ‘a’ cannot be declared in this scope because it would give a different meaning to ‘a’, which is already used in a ‘parent or current’ scope to denote something else (line 84)
  2. Error (CS0103): The name ‘a’ does not exist in the current context (line 125)

You men adding a Boolean component?

Thanks
Will

Get the general case on that matter (and you don’t need a class for similar simple stuff … unless you want to do queries, monitor each object with some properties … blah, blah). On the other hand using DataTrees (custom collection valid only in GH) restricts the portability to other apps (if this is the case with you).

As a challenge replace Boxes with Spheres (or anything else) but have in mind that bing N of non rectilinear geo slows things down.

Box_RandomOrtho_WithAttractors_V1.gh (123.9 KB)