String.replace within sublists

Hello everyone,

Another day, another Dynamo challenge :slight_smile:

I am working on automating my wall legend creation. What I have managed to do is read the wall’s compound structure layers’ materials. Now, as the naming convention used by the architect is not exactly our firm’s naming convention I want to string.replace my way out of it! :slight_smile: As well, I read the material’s thickness and try to ‘string.insert’ this information at the end of the materials’ strings. I hope my intention is clear!

Now, for one wall type at a time this is working flawlessly. However, I do not want to repeat this for each wall type (30+) and so I am trying to work with lists while replacing these strings, so I only have to hit ‘run’ once for my entire legend. Please see the attachment. In this example I have 4 wall types [0] through [3] with their respective materials. In this case I am trying to replace the string ‘CW-profielen’ (left) for every list item with its respective replacements (on the right). Although in this case they all say ‘600mm’, obviously this number can vary per wall type.

How can I manage to replace the ‘CW-profielen’-string of list item [0] with the ‘CW-profielen, h.o.h.: 600mm’ of item [0], [1] with [1], [2] with [2] and [3] with [3]?

I have been trying all morning, it should not be so hard! I am thinking something like list.map .combine .cycle? I am looking forward to your suggestions!

Hi René, I think this should work for you (just replace “c” by the string you want to replace) :

Straight forward on the latest build