Hey, Did You Know: Lacing Operations

Hey, did you know how Lacing Operations work in Dynamo? :thinking: It is important to understand how to manage data flow between lists! :star2: Lacing determines how nodes handle list combinations in your scripts. :jigsaw: Here’s the quick breakdown:

:small_blue_diamond: Shortest: Matches lists element by element, stopping at the shortest list.
:small_blue_diamond: Longest: Extends the shorter lists by repeating their last elements to match the longest one.
:small_blue_diamond: Cross-Product: Generates every possible combination between elements of both lists.
:small_blue_diamond: Auto: Automatically adjusts the lacing mode based on the input lists and node logic.

Mastering lacing operations and list management in Dynamo will bring a lot of flexibility for your Dynamo workflows! :rocket:

Which lacing mode do you use the most? Or are you curious to explore a specific one? Let’s chat in the comments! :point_down:

8 Likes

I’m not sure if it’s okay to reply in this thread as I don’t see any other responses – but I’ll give it a try:
I have a question about the ‘auto’ lacing type – is it capable of producing a result that cannot be replicated by ‘shortest,’ ‘longest,’ or ‘cross-product’? I feel like I encountered something like this in a certain combination before, but I can’t figure out how to reproduce that behavior. Most of the time, ‘auto’ behaves like ‘shortest’ for me. Thanks for your help!

Not really, but kinda. But it certainly makes life easier so you don’t want to remove it.

Auto lacing defaults to shortest lacing, except for when one input is a single input.

So if you have a list of letters such as [A, B] and a list of numbers such as [1, 2, 3, 4] wired into a + node with shortest lacing you get [A1, B2], but longest lacing you get [A1, B2, B3, B4], and cross product would be [ [A1, A2, A3, A4], [B1, B2, B3, B4] ]. So with Auto lacing in this situation both inputs are a list which means the lacing used is shortest, so we get [A1, B2]. But if you change the first input to just A auto lacing sees the single input and switches to longest lacing so you get [A1, A2, A3, A4].

Things get more complex as you add inputs (i.e. with setting multiple parameter values for a multiple elements to multiple sets of unique values), but this basically covers it. If you would like to see a more visual example, the Dynamo Office Hours series from WAY back when here covers it well.

The following session is also likely of interest, as it covers list levels.

1 Like