# \#loop

**URL:** https://forum.dynamobim.com/tag/loop/21.md

[Latest](https://forum.dynamobim.com/latest.md) · [Categories](https://forum.dynamobim.com/categories.md) · [Tags](https://forum.dynamobim.com/tags.md)

---

## [While Loop Levels Help](https://forum.dynamobim.com/t/while-loop-levels-help/100900)

<div class="topic-metadata">

**Author:** [@phillip.austin](https://forum.dynamobim.com/u/phillip.austin)\
**Replies:** 1\
**Last updated:** [May 11, 2024, 9:15am UTC](https://forum.dynamobim.com/t/while-loop-levels-help/100900 "2024-05-11T09:15:55Z")

</div>

I am having some trouble using the while loop node with a list. I keep starting an infinite loop that will eventually crash Revit. Is there a way to force stop the loop so I dont have to restart every time? This is ex…

---

## [Loop run script for each element](https://forum.dynamobim.com/t/loop-run-script-for-each-element/93762)

<div class="topic-metadata">

**Author:** [@p.jaroszewiczYPMV3](https://forum.dynamobim.com/u/p.jaroszewiczYPMV3)\
**Replies:** 5\
**Last updated:** [September 14, 2023, 3:00pm UTC](https://forum.dynamobim.com/t/loop-run-script-for-each-element/93762 "2023-09-14T15:00:03Z")

</div>

Hi, is there an option to make loop run script that takes elements from list individually for each run session? Something like that: Take first element from list and run script, then take second element and run script an…

---

## [Using WhileLoop](https://forum.dynamobim.com/t/using-whileloop/91457)

<div class="topic-metadata">

**Author:** [@maciej.wojtunik](https://forum.dynamobim.com/u/maciej.wojtunik)\
**Replies:** 4\
**Last updated:** [July 5, 2023, 2:00pm UTC](https://forum.dynamobim.com/t/using-whileloop/91457 "2023-07-05T14:00:01Z")

</div>

Hello, I need to run a Function (green gruop) for each element in list (Data node on the beginning). I created such a WhileLoop, but it doesn’t work. The output is run the Function only for the last element . Does …

---

## [Dynamo - Loop part of the script for each item on a list](https://forum.dynamobim.com/t/dynamo-loop-part-of-the-script-for-each-item-on-a-list/91378)

<div class="topic-metadata">

**Author:** [@LOESCH\_PK](https://forum.dynamobim.com/u/LOESCH_PK)\
**Replies:** 3\
**Last updated:** [July 4, 2023, 2:44pm UTC](https://forum.dynamobim.com/t/dynamo-loop-part-of-the-script-for-each-item-on-a-list/91378 "2023-07-04T14:44:44Z")

</div>

Dear Dynamo users/masters. I have possibly an easy/newbie question with looping part of the script. I have a problem with Element.FilterByParameterValue node (so i think). I’m trying to filter down a list of all rooms o…

---

## [Creating Loop for function between two lists](https://forum.dynamobim.com/t/creating-loop-for-function-between-two-lists/90766)

<div class="topic-metadata">

**Author:** [@m0stafakamal](https://forum.dynamobim.com/u/m0stafakamal)\
**Replies:** 5\
**Last updated:** [June 15, 2023, 2:38pm UTC](https://forum.dynamobim.com/t/creating-loop-for-function-between-two-lists/90766 "2023-06-15T14:38:31Z")

</div>

Hello, i have a list of lines and i want to get the intersection between first line of the list with all other lines, then make a loop with same process but between second line of the list with all other lines, etc i…

---

## [Creating a 'for loop' as index for GetItemAtIndex](https://forum.dynamobim.com/t/creating-a-for-loop-as-index-for-getitematindex/88442)

<div class="topic-metadata">

**Author:** [@kylemagpantay222](https://forum.dynamobim.com/u/kylemagpantay222)\
**Replies:** 4\
**Last updated:** [April 12, 2023, 12:43pm UTC](https://forum.dynamobim.com/t/creating-a-for-loop-as-index-for-getitematindex/88442 "2023-04-12T12:43:28Z")

</div>

Good day! I would like to ask about ‘for loops’ in Dynamo. What I’m trying to achieve is that I would like to automatically place ‘Flow’ values on every Air Terminal in a certain space based on the spaces’ ‘Specified Su…

---

## [Possibility to create a "copy and save as .dwg" loop](https://forum.dynamobim.com/t/possibility-to-create-a-copy-and-save-as-dwg-loop/86193)

<div class="topic-metadata">

**Author:** [@OfflineGuy](https://forum.dynamobim.com/u/OfflineGuy)\
**Replies:** 1\
**Last updated:** [February 15, 2023, 4:19pm UTC](https://forum.dynamobim.com/t/possibility-to-create-a-copy-and-save-as-dwg-loop/86193 "2023-02-15T16:19:39Z")

</div>

Dear fellow Dynamo Users, I’m currently looking for possibilities to create a workflow that makes a copy of an existing dwg and saves it under a new name. For example I have a Template.dwg in which I would like to perfo…

---

## [Explode nested block references with loop](https://forum.dynamobim.com/t/explode-nested-block-references-with-loop/85830)

<div class="topic-metadata">

**Author:** [@Bimbimbim](https://forum.dynamobim.com/u/Bimbimbim)\
**Replies:** 1\
**Last updated:** [February 10, 2023, 10:31am UTC](https://forum.dynamobim.com/t/explode-nested-block-references-with-loop/85830 "2023-02-10T10:31:55Z")

</div>

Hi all, long time reader but first time poster so aplogies if i mess something up :slight\_smile: Bit of background: I have multiple DWGs containing nested block references. The number of layers the block references are…

---

## [Looping list and custom structural framing type](https://forum.dynamobim.com/t/looping-list-and-custom-structural-framing-type/78875)

<div class="topic-metadata">

**Author:** [@anacffaria](https://forum.dynamobim.com/u/anacffaria)\
**Replies:** 4\
**Last updated:** [August 2, 2022, 12:58pm UTC](https://forum.dynamobim.com/t/looping-list-and-custom-structural-framing-type/78875 "2022-08-02T12:58:40Z")

</div>

Hi, I’m new to dynamo and I’m trying to do a simple structure whose information is stored in excel. The geometry part is ok but now I’m having doubts on how to loop the the list. Basically I want to do the group “Attri…

---

## [Strange LoopWhile](https://forum.dynamobim.com/t/strange-loopwhile/79008)

<div class="topic-metadata">

**Author:** [@Ahmed\_Ramy](https://forum.dynamobim.com/u/Ahmed_Ramy)\
**Replies:** 12\
**Last updated:** [July 25, 2022, 8:39am UTC](https://forum.dynamobim.com/t/strange-loopwhile/79008 "2022-07-25T08:39:31Z")

</div>

Again, the strange and mysterious loopwhile is unclear how it works or even where the code flows.??? And I don’t understand what is missing it to work ???

---

## [How can I create a node loop?](https://forum.dynamobim.com/t/how-can-i-create-a-node-loop/78256)

<div class="topic-metadata">

**Author:** [@stemilan96](https://forum.dynamobim.com/u/stemilan96)\
**Replies:** 1\
**Last updated:** [July 1, 2022, 4:11pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-node-loop/78256 "2022-07-01T16:11:39Z")

</div>

Hello there, I’ve got this situation, where the node ‘‘sastrugi’’ should let me to get a closed curve from a coordinate list But it doesn’t work to me. In fact, the node works just if I get a single index by the li…

---

## [Repeat same script in smaller chunks](https://forum.dynamobim.com/t/repeat-same-script-in-smaller-chunks/75783)

<div class="topic-metadata">

**Author:** [@Bartholin](https://forum.dynamobim.com/u/Bartholin)\
**Replies:** 2\
**Last updated:** [April 24, 2022, 9:57pm UTC](https://forum.dynamobim.com/t/repeat-same-script-in-smaller-chunks/75783 "2022-04-24T21:57:04Z")

</div>

Hi all - sorry for the long post. I am asking for general word of advice. I understand the fundamentals of dynamo in regards to code block scripting, levels and lacing. I haven’t invested time in playing with python a…

---

## [Save multiple revit models, each with unique ProjectInfo parameters](https://forum.dynamobim.com/t/save-multiple-revit-models-each-with-unique-projectinfo-parameters/74067)

<div class="topic-metadata">

**Author:** [@disco](https://forum.dynamobim.com/u/disco)\
**Replies:** 1\
**Last updated:** [March 8, 2022, 5:44am UTC](https://forum.dynamobim.com/t/save-multiple-revit-models-each-with-unique-projectinfo-parameters/74067 "2022-03-08T05:44:30Z")

</div>

In summary I am trying to create multiple revit models, each with unique project parmeters driven by an excel spreadsheet. I am trying to speed up project setup on large jobs with multiple models. My approach has been t…

---

## [N-time loop of a function](https://forum.dynamobim.com/t/n-time-loop-of-a-function/71733)

<div class="topic-metadata">

**Author:** [@stef](https://forum.dynamobim.com/u/stef)\
**Replies:** 4\
**Last updated:** [December 27, 2021, 9:09pm UTC](https://forum.dynamobim.com/t/n-time-loop-of-a-function/71733 "2021-12-27T21:09:00Z")

</div>

Hello, im trying to apply a function n-times to a variabel. In the screenshot I build it up with nodes, but just four times. The goal is to loop this function as often as I want to, and have a list with every single (n-…

---

## [Apply a function to each item in a list before continuing to the next](https://forum.dynamobim.com/t/apply-a-function-to-each-item-in-a-list-before-continuing-to-the-next/71600)

<div class="topic-metadata">

**Author:** [@LCarrozza4MGVV](https://forum.dynamobim.com/u/LCarrozza4MGVV)\
**Replies:** 7\
**Last updated:** [December 25, 2021, 3:53pm UTC](https://forum.dynamobim.com/t/apply-a-function-to-each-item-in-a-list-before-continuing-to-the-next/71600 "2021-12-25T15:53:44Z")

</div>

Hello, I’m trying to iterate though a list and apply a function to each element in the list before continuing to the next item. See image below for what what I currently have. This part of the graph uses the Orchid and C…

---

## [Looping a complex algorithm](https://forum.dynamobim.com/t/looping-a-complex-algorithm/56908)

<div class="topic-metadata">

**Author:** [@rubenbosetti](https://forum.dynamobim.com/u/rubenbosetti)\
**Replies:** 15\
**Last updated:** [July 13, 2021, 3:24pm UTC](https://forum.dynamobim.com/t/looping-a-complex-algorithm/56908 "2021-07-13T15:24:07Z")

</div>

Hey guys, I share the issue I’m addressing, hoping some of you masters have the answer. I’m working on a long algorithm which works like this: Reads data from an excel file: each row of the file represents data for g…

---

## [Loop while value is not null](https://forum.dynamobim.com/t/loop-while-value-is-not-null/64986)

<div class="topic-metadata">

**Author:** [@renanemeyer](https://forum.dynamobim.com/u/renanemeyer)\
**Replies:** 4\
**Last updated:** [June 10, 2021, 2:49pm UTC](https://forum.dynamobim.com/t/loop-while-value-is-not-null/64986 "2021-06-10T14:49:37Z")

</div>

Hello everyone. I’m frozen at the end of a routine. I need the value to be included in the “Value” of “Element.SetParamterByName” do a loop: If “A-01” is Null, continue reading to “A-03” and enter the first non-nul…

---

## [Looping...?](https://forum.dynamobim.com/t/looping/63131)

<div class="topic-metadata">

**Author:** [@Giovanni\_Succi](https://forum.dynamobim.com/u/Giovanni_Succi)\
**Replies:** 4\
**Last updated:** [April 24, 2021, 4:02pm UTC](https://forum.dynamobim.com/t/looping/63131 "2021-04-24T16:02:38Z")

</div>

Hi all, I am not even sure how to search for this… See attached: is there a way to achieve this looping? Basically I need: assign next value to the element parameter (it just switches the type of a legend compone…

---

## [Get updated/actual element after change of parameter within a loop](https://forum.dynamobim.com/t/get-updated-actual-element-after-change-of-parameter-within-a-loop/62837)

<div class="topic-metadata">

**Author:** [@Legion](https://forum.dynamobim.com/u/Legion)\
**Replies:** 4\
**Last updated:** [April 15, 2021, 4:48pm UTC](https://forum.dynamobim.com/t/get-updated-actual-element-after-change-of-parameter-within-a-loop/62837 "2021-04-15T16:48:08Z")

</div>

Hello everyone, I try to create a workflow for an automated solving of clashes by moving elements or parts of it. In my example I have a mobile crane and i can move the “arm” up and down by changing the angle. With py…

---

## [Python: Loop through list and IF statement](https://forum.dynamobim.com/t/python-loop-through-list-and-if-statement/39577)

<div class="topic-metadata">

**Author:** [@spenny18](https://forum.dynamobim.com/u/spenny18)\
**Replies:** 6\
**Last updated:** [August 18, 2019, 2:54pm UTC](https://forum.dynamobim.com/t/python-loop-through-list-and-if-statement/39577 "2019-08-18T14:54:02Z")

</div>

Hi all, I am having some trouble with a basic python function, and am need of help. Basically, I am working on a furniture plan, and just learned that some cubicle panels only come in certain lengths. I want to check t…

---

## [Loop in a List](https://forum.dynamobim.com/t/loop-in-a-list/62055)

<div class="topic-metadata">

**Author:** [@renanemeyer](https://forum.dynamobim.com/u/renanemeyer)\
**Replies:** 2\
**Last updated:** [March 24, 2021, 4:22pm UTC](https://forum.dynamobim.com/t/loop-in-a-list/62055 "2021-03-24T16:22:45Z")

</div>

Hello All, Looking for a simple recursive loop code example using Design Script code block that i can send a list of objects though rotating some of them with each loop. I looked for several examples here on the forum,…

---

## [Python for Dynamo; error for loop: index out of range](https://forum.dynamobim.com/t/python-for-dynamo-error-for-loop-index-out-of-range/60461)

<div class="topic-metadata">

**Author:** [@matinting13](https://forum.dynamobim.com/u/matinting13)\
**Replies:** 16\
**Last updated:** [February 24, 2021, 9:47am UTC](https://forum.dynamobim.com/t/python-for-dynamo-error-for-loop-index-out-of-range/60461 "2021-02-24T09:47:44Z")

</div>

Hi, I am kind of a noob of Python, but I am using Python to build a node in Dynamo for Civil 3D, and I’m facing some problems with the following loop, giving me the error “Traceback (most recent call last): File “”, line…

---

## [Running time for a while loop inside an imperative block](https://forum.dynamobim.com/t/running-time-for-a-while-loop-inside-an-imperative-block/50102)

<div class="topic-metadata">

**Author:** [@olop](https://forum.dynamobim.com/u/olop)\
**Replies:** 4\
**Last updated:** [May 3, 2020, 5:10pm UTC](https://forum.dynamobim.com/t/running-time-for-a-while-loop-inside-an-imperative-block/50102 "2020-05-03T17:10:48Z")

</div>

Hi. I’m very new to Dynamo for Revit and recently I’ve tried to make a while loop inside an imperative block the following input values used to create the loop. My problem is that the running time is about 30 seconds, …

---

## [Loop, sorting elements at list](https://forum.dynamobim.com/t/loop-sorting-elements-at-list/44529)

<div class="topic-metadata">

**Author:** [@Izabela](https://forum.dynamobim.com/u/Izabela)\
**Replies:** 1\
**Last updated:** [December 16, 2019, 11:41pm UTC](https://forum.dynamobim.com/t/loop-sorting-elements-at-list/44529 "2019-12-16T23:41:54Z")

</div>

Hi everyone, I want to sort my list and its sublists in a certain way. I’ve got List of points that includes 7 “main lists” (from 0 List to 6 List), and each of these lists contains 17 points (indexes from 0 to 16) (sma…

---

## [Looping a differenz between Items in a List](https://forum.dynamobim.com/t/looping-a-differenz-between-items-in-a-list/43355)

<div class="topic-metadata">

**Author:** [@alejandre](https://forum.dynamobim.com/u/alejandre)\
**Replies:** 2\
**Last updated:** [November 19, 2019, 1:51pm UTC](https://forum.dynamobim.com/t/looping-a-differenz-between-items-in-a-list/43355 "2019-11-19T13:51:22Z")

</div>

Hi to everybody, As you can see in the pic, I am trying to rest the second Item of a list with the first one, then… the third one with the second one… and so, till last item… It´s possible to create a loop to this oper…

---

## [Iterate through the dynamo graph](https://forum.dynamobim.com/t/iterate-through-the-dynamo-graph/40602)

<div class="topic-metadata">

**Author:** [@mariaesp2019mex](https://forum.dynamobim.com/u/mariaesp2019mex)\
**Replies:** 5\
**Last updated:** [September 18, 2019, 2:09pm UTC](https://forum.dynamobim.com/t/iterate-through-the-dynamo-graph/40602 "2019-09-18T14:09:49Z")

</div>

Hi, as of now I’m creating only 1 new family type and then modifying its parameters and with all of those new values, changing a Wall and saving it as a “.rvt” file in a path in the computer. But now, I want to go a step…

---

## [List.map for node with two,or more list inputs](https://forum.dynamobim.com/t/list-map-for-node-with-two-or-more-list-inputs/9467)

<div class="topic-metadata">

**Author:** [@Hannes](https://forum.dynamobim.com/u/Hannes)\
**Replies:** 10\
**Last updated:** [August 14, 2019, 10:02am UTC](https://forum.dynamobim.com/t/list-map-for-node-with-two-or-more-list-inputs/9467 "2019-08-14T10:02:54Z")

</div>

Hi, is there a simple solution to use list.map for a function with more than one list input? If i use a single number for “distance” its works, but not for a list of course. How i can loop over a list with a function…

---

## [Iterate thru lists with While Loop in Code Block](https://forum.dynamobim.com/t/iterate-thru-lists-with-while-loop-in-code-block/38728)

<div class="topic-metadata">

**Author:** [@AverageG](https://forum.dynamobim.com/u/AverageG)\
**Replies:** 2\
**Last updated:** [July 25, 2019, 6:14pm UTC](https://forum.dynamobim.com/t/iterate-thru-lists-with-while-loop-in-code-block/38728 "2019-07-25T18:14:10Z")

</div>

Hello, Can some one please tell me what is wrong with this loop? It appears like it’s not going thru the list iterations at all if I get the return value of i to be 0.

---

## [While Loop | I want loop to output a list, but its outputting "Empty Dictionary"](https://forum.dynamobim.com/t/while-loop-i-want-loop-to-output-a-list-but-its-outputting-empty-dictionary/38382)

<div class="topic-metadata">

**Author:** [@Connor](https://forum.dynamobim.com/u/Connor)\
**Replies:** 2\
**Last updated:** [July 17, 2019, 12:01pm UTC](https://forum.dynamobim.com/t/while-loop-i-want-loop-to-output-a-list-but-its-outputting-empty-dictionary/38382 "2019-07-17T12:01:32Z")

</div>

Hello, Please assist with the following: I have a list of viewport widths (coincidentally the same value here) which I would like to sum one-by-one until it exceeds the max x-coordinate of my sheet. I would like the…

---

## [Loop and exporting problems (Dynamo/RSA/optimo)](https://forum.dynamobim.com/t/loop-and-exporting-problems-dynamo-rsa-optimo/37419)

<div class="topic-metadata">

**Author:** [@mnedJ3Y62](https://forum.dynamobim.com/u/mnedJ3Y62)\
**Replies:** 4\
**Last updated:** [June 24, 2019, 9:17pm UTC](https://forum.dynamobim.com/t/loop-and-exporting-problems-dynamo-rsa-optimo/37419 "2019-06-24T21:17:59Z")

</div>

Hi I am trying to make a loop using optimo to find the optimal sections for my structure evaluated by the wightscore - but i am facing som troubles being new in the program. First of all i am having troubles exporting …

[Next page](https://forum.dynamobim.com/tag/loop/21.md?match_all_tags=true&page=1&tags%5B%5D=loop)
