Array Rank: Graph Nodes vs. Scripting


#1

I am trying to show the correspondence between programming with Dynamo nodes and with scripts using replication guides. In the following example, I am attempting to build a 2D array of points. Using graph nodes a cartesian product of two lists [X and Y] and a single [for Z] value creates an array of rank 3 [which is unexpected] and with the result that the generated array of points cannot be used as input to a curve creation method. Using scripting with replication guides, two lists [X and Y] and a single [for Z] creates an array of rank 2
[as expected] and the generates array of points can be used as input to a curve creation method.

Is there in fact a way to achieve the desired result of a 2D array of points using the graph nodes? If so could you offer some guidance? Or if this is a bug, please confirm and when can this be addressed? Many thanks!

dynamo-nodevscript


#2

From my experience, graph nodes always base their cross-product on the shortest provide list. (in your case 10 is automatically converted to a list) While CBNs always need their list ranking to be clearly specified. To add ranking to the 7, I’ll need to manually convert it into a list. If you want to get similar ranking with the graph nodes, you might need to use the XY Point in combination with “Point.Add”. Or alternatively flatten the list and group by X or Y.

Capture1