Concat Lists

I’ve got a list of sheets (from Revit) and a list of “packages” which those sheets are included in. I’m trying to combine/create a cumulative list which reflects each package that a sheet is included in. Per the included snipit, if Sheet A is included in Pkg1 & Pkg2, Sheet B is included in Pkg2 & Pkg3, Sheet C is included in Pkg1 & Pkg3, & Sheet D is included in Pkg1, Pkg2, & Pkg3 I’d like to combine/concat those values into a single string, listed per sheet. Thanks in advance and please let me know if additional description/definition is required.

Your lists are backwards. Right now you have packages and their respective sheets. You want sheets with their respective packages. You may have to filter the packages based on the list of sheets to get what you want.

Thanks for prompt reply Nick and I apologize for being so dense but I don’t understand. The way I view it I have both a list of Sheets and their respective Packages and a list of Packages and their respective sheets. Per the attached snipit, I flipped the keys and lists as I believe that provides what you’ve stated above but I still don’t know where to go from here, or if this what you were intending from your reply.

Your lists are still the same. Each group (sublist) represents a package and all the sheets contained in that package. You want groups of sheets, with each package that sheet belongs to.

We can still filter the sheets to get the same outcome though. Just use your original list of (unique) sheets and compare them with the grouped list of sheets and use that to filter the list of packages.


Now it’s a simple case of concatenating your packages.

2 Likes

Hi @frenga ,

Have you tried the node List.Combinations?

1 Like

Thank you for the help Nick! This did the trick. I had some issues getting over my density to figure out my list levels but this was perfect! I’m sure I’ll run into some other issues while wrapping this up but this was exactly what I needed for now. Note for anyone else that comes across this that the combining of the strings was easily accomplished with this list structure by using String.Join.

1 Like