Lacing in CodeBlocks... (SetParameterByName)

There are two things at work here, Lacing and List@Level. In DesignScript, lacing is controlled using Replication Guides.

The syntax for Replication Guides is as follows: variable< number >

The number itself only matters in relation to the other numbers within the Replication Guides (To my knowledge).

So x<1>, y<2>, z<3> is the same as x<21>, y<35>, z<771> - What matters in this case is that both X-values are the lowest Replication Number, both Y-Values are the middle and both Z-Values are the highest.

Within Replication, you are telling DesignScript how to pair data. This is done hierarchically. In your example, you are taking your primary list of Elements, and pushing them against a parameter name and a parameter value where all of these lists have a variance in number.

As other examples in this thread point out, you can achieve this using List@Level, but it is also achievable via Replication.

In order to take a variable list of Elements as input (In my example below Areas), and take a variable list of Parameters to then subsequently wipe out any housed data with a single input list, you can approach replication as follows:

My list of Areas are defined by the Elem input port. Because I want to replicate over every element in here, this list needs to have the highest priority. We thus put in a replication of the lowest number: In this case it’s <1>.

We then want to take a variable amount of Parameters to set data to, which we will stipulate as our third strongest replication over the name input port: In this case it’s <3>. The reason for this is that we want to pair every single one of these (In essence, a longest lacing or cross-product option) to the val input port which contains a singular item (Empty string) set to a replication level of <2>.

The result of this is that every single element (Area), will push an empty string (Val) to every single parameter chosen (name).

If you switch up the Replication, the results change as can be seen below:

Here when we stipulate a paired replication, it will simply mimic the shortest lacing option.

The concept itself is a little escoteric, but supremely powerful. You can, in essence, pair any number of data points with any other number. It both mimics Shortest, Longest and Cross-Product lacing options but also extends that functionality beyond.

12 Likes