Concatenating multiple strings and lists of strings in code block with cross lacing

Hi All,

My goal: Create with dynamo an excel list of all the possible sheet numbers in a project based of the many fields composing that.
My strategy so far: create a code block for concatenating all the single field strings.
My issue: some of the fields (like the project number, are always the same, so a simple string is needed, some others, like the level or discipline, can have different values [ie 1F, 2F, etc.]; I have multiple single string fields and multiple lists of strings fields, and I would like to convey them in one single concatenating code block

basic sintax: a + “-” + b + “-” + …

Now, as long as I add a single strings, or the first list of strings, everything works fine:

The problem raises when I get to the second list, which I would like to cross lace, to add a dimension to the matrix. I can’t wrap my brain around how that is working. can someone help here?

Thanks a lot :slight_smile:

I think you’re just using the wrong notation. See if this works for you.

Also, keep in mind, the more inputs you have, the more complex the list levels become. In some scenarios you can have more inputs that can be effectively controlled by list levels alone. It’s always best to keep things as simple as possible. In this case, you could concatenate your “constants” (single inputs) in one step and then use list levels to append the lists in a separate step. Don’t feel like you always have to do everything at once.

Hi @Nick_Boyts, thanks a lot for the suggestion!
I actually solved my problem by understanding at which level of the lists I had to pull the data from:

Also thanks for the tip at the end, my problem is that I started with this fixed strings but as I develop this they will eventually need to be pulled from parameters in my revit project.

Now though, I have a new problem, maybe you know how to solve it:

I get my list of all possible drawing numbers, with each field separated by hyphens. What I need is to truncate each string into a list of substrings, one for every field and hyphens, but I find myself at a dead end:

example:

String = Location-Site-Building-Area-Level-etc…
List of substrings I would like to get = [Location, -, Site, -, Building, -, Area, -, Level, -, etc…]

I tried with List.Split node but I lose my precious hyphens.
I also thought of list.chop, but as you see, some strings of the discipline list have different lenghts, so that also wouldn’t work.

What I would like to use would be a node that recognizes all the hyphens like list.split, but simply chops the string before and after them.

Does anything like this exists?

Thanks a lot!

What’s the reason for pulling them apart? Losing the hyphen isn’t likely a big deal since you could put it back just as easily. It would be helpful to know what your end goal is here.

My idea is to in the final place have a workflow for creating drawing sets for every new project of my company.

The workflow I thought about is this:

  1. Use dynamo to create all possible drawing numbers (I am not an expert of excel, but if this can be achieved directly with it it is probably better) and export to excel
  2. In excel, make a table with the data in order to be able to filter combinations that I don’t need (ie, I only need plans for WR discipline)
  3. Feed the filtered table back to dynamo to create the sheets with their names and parameters assigned in revit

In the future also I’d like to populate the sheets with the corresponding plans as well.

I’m not an Excel expert either but I’d bet you could recreate that functionality directly in Excel.

On the other hand, you probably don’t need Excel at all. You could use Dynamo Player inputs or something like DataShapes to select the discipline, levels, etc from the Dynamo graph itself. That would allow you to filter your options ahead of time and create only the sheets based on your selections.

Oh I didn’t know about DataShapes, thanks!

I will try it out!