Lacing In Dynamo

Annisa Rizal
BravoVictorNovember
4 min readMay 23, 2018

The other day I was working in Dynamo and I was trying to access a specific item within each of a list of lists. I’m a novice at Dynamo so I started to play with settings within the node to see what changes it would do to my script. By accident I came across what Dynamo calls ‘lacing’.

What is lacing in dynamo? And how did it help achieve the problem I was trying to solve? I’ve written it up, mainly to get it straight in my own head, so hopefully this will be useful to you too!

Lacing is a feature in Dynamo that helps you do two things:

  1. Handle multiple sets of data that are equal or different in length. You can think of it as data matching.
  2. Access the nth item in many lists, or the whole of the nth list

There are three possible modes you can choose from: Shortest, Longest and Cross Product.

To change the lacing settings, right click the bottom right corner of the node.

Once you have chosen a setting, the symbol will also change.

Keep reading to see how you can apply lacing to your scripts in Dynamo when you need to data match or access items within a list of lists!

Data Matching

Shortest

In Dynamo this is the default setting. Shortest Lacing associates each item of a list with the corresponding item in the other list. If the lists are different lengths the items at the end of the longer list is ignored.

Longest

Longest Lacing associates each item of the list with the corresponding item on the other list, and reuses the last item until there are no more items left in the other list.

Cross Product

Cross Product Lacing connects each item in one list to all items in the other list. Be careful when using this setting. Large datasets can cause performance issues and cause Dynamo to crash altogether. The number of results is the number of inputs squared.

Lists Access: getting the nth item in many lists, or the whole of the nth list

Shortest

Shortest Lacing selects the items in the first list in the data structure at the chosen index. This is shown by the blue line in the picture below.

Longest

Longest Lacing selects the nth item of each list, where n is the index that you chose. You’d get the items outlined by the orange line in the picture below.

Cross Product

Cross Product Lacing does a similar thing to Longest Lacing but wraps each item in a list. I haven’t found a use case for this myself, but if anyone has any suggestions, let me know!

Conclusion

Lacing controls the interactions between lists when you need to data match or access an item buried in lists of lists. It is often missed by new users of dynamo — and it’s something that I wish I’d known about earlier rather than accidently finding it on my own. It’s really handy when dealing with lots of data and solved my problem with a click of a button!

--

--