How to loop the whole script

Hello,
I’ve created a script that reinforce a column (main bars,stirrups the whole thing) based on selected element and chosen diameters for the rebars. My problem is that the way i’ve created it,the script works when only fed one element( i use the faces of the element and when i select 2 elements the rebars are created but in a strange geometry between the 2 elements) .
Is there a way to select all columns and force dynamo ( i guess with a loop) to feed my script just one element at a time (i’ve tried to make the initial list of columns in sub lists with one element only,but the script doesn’t work properly).The idea is to take the first element ,run it through the script and when it’s over to go back at the start and take the next one.
Thanks in advance!

You could pack all your nodes from your original graph into a custom node and simply feed that node with a list of elements. :slight_smile:

5 Likes

@Jonathan.Olesen The script itself runs faster,when put in custom node,but when i feed list of elements to the custom node,it doesn’t work

Can you show your graph and the subsequent errors?

Have you tried using your custom node together with “List.Map” having the elements as your “list” and your custom node as the “f(x)”.

There is a significant speed decrease in runtime, (factor 3) as far as my own tests at least, when converting a heavy graph into a custom node.

Using list levels or a list.map.

1 Like

@Jonathan.Olesen We have a little progress with levels but it’s not what i want.I can send you a mail with my custom node if it’s okay for you.The graph is huge and not very well structured so i cannot take a good picture :slight_smile:

Sure, although you can always zoom in on a node and use the camera icon in the right corner to take pictures of the entire graph that can be read.

image

Just know that I’m on dynamo 1.3.x so I will not be able to open 2.0 files :slight_smile:

@Jonathan.Olesen and @PauLtus thanks a lot for the help.I’ve managed to get it to work properly using levels and changing the graph a bit.Now i can reinforce all my columns based on a excel table with the diameters for the columns on every floor with one click of a button.

THANKS!

1 Like

Can you be a champ and add your finished graph to this topic for people facing this issue in the future? :slight_smile:

I’ve just used levels on my custom node

I noticed you’ve marked one of my comments as solution and later one of @Jonathan.Olesen .

You can only mark one comment as a solution, that one should be the comment that when someone would find your topic having the same or similar question could the most easily solve it with.

If you find a comment to be useful but doesn’t, please give it a like to it, these might be comments that might have given you a step in the right direction and you’re not limited to handing out only a single one per topic.

I’d suggest to give @Jonathan.Olesen comments that helped you a like.

Another advice on your final custom node:

You can give little bits of texts to your input nodes so when the node is created you can actually see what input you want to give for which part of the node, next to that, I’d suggest adding an output node in your custom node (and maybe give that one a name as well), so you won’t end with such a massive list of outputs but only the output you want.

2 Likes

Thanks @PauLtus !!! I didn’t know i can do that :slight_smile:
Your advice is excellent.I wanted to add text to my input but unfortunately i couldn’t find where to do that.
Thanks for the output idea as well!

1 Like

In addition you can delete the “output” nodes that you do not require from your custom node removing any unnecessary outputs (making the node physically smaller).

1 Like