Help needed using "LoopWhile" node

Hey there,

I’m hoping to get a functioning script I currently have into a looping version and I’m hung up on the loop.while node. I’m not seeing a ton of info on this node. I’m open to other ways to accomplish the end goal, such as restructuring the script, but looping makes sense to me at this point. The first snip runs indefinitely, the second works nice for one iteration.

-Does this script run indefinitely simply because the “continueWhile” bit isn’t activating?
-If the node will work for this application, what can I try? I attempted to emulate the node usage based on a youtube video i came across.
-If python can be used, but this node can’t, where’s a good start?

End goal:
I’m trying to create a series of lines that are either 6, 5, or 4 ft apart (preferably 6’). I also want these lines to avoid the rectangular detail component seen in the snip. I have successfully created a script that creates one iteration only, which starts at a line i select manually (labeled 1). Hopefully a given line can continue to be offset from last iteration, until a line intercepts the second line (labeled 2) selected or something similar. Apologies, I’m not able to share my files I guess. I can share more about the workflow if this isn’t clear, let me know.

Thank you for the time,



Yes, from memory Loop While is a bit confusing. Which I think is partly because Dynamo is so set by a left to right linear logic…

I did find this, which seems to make sense (apologies, I didn’t understand everything about your workflow) Inputs for LoopWhile : to have dynamic x data to loop node actions

Another way is to use Python…

Hope that helps,


1 Like

I’m going to take a crack at a python version and report, hopefully it will be cleaner.
I also realized none of my nodes are visible, oops.