Iterate script from list

I’ve been reading many posts but I’m unable to find something that should be fairly simple (more likely I’m not understanding); Get a list and loop that list through a script one at a time until the list is finished.

I’m able to pull the sheet numbers and pull the discipline designation and make a list showing all available discipline letters.

I’m also able to search and count all of those disciplines, but not from the list. Instead I need to create a separate script for each discipline, which I feel is unnecessary. Is there a way I can take my list and plug it into the string value and iterate the script?



With Dynamo you’re really not trying to “loop” an entire graph in a programming sense. You’re more trying to make everything function with multiple inputs or lists.

Getting your graph to work with one input (M sheets in this case) should always be your first step. Now that you have that working it’s time to break your graph.

You’ll have to change the lacing or @Level input of many of your nodes, but it should be as simple as that. To start, instead of searching for strings starting with just M, input your whole list of prefixes so that String.StartsWith returns a list of booleans for each letter. Now you just have to go through your graph node by node and make the lacing/level changes to get your nodes to work for lists of lists.

Give that a try and see where it gets you.

EDIT:
Your other option is to make a custom node. Wrap everything up in your own custom node. It shoud still accept a single input fine. You can then set the lacing for your node to longest and input an entire list with no problem.