# Replace a list instead of item at index in nested list

**URL:** <https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780>\
**Category:** Uncategorized\
**Created:** [December 31, 2017, 5:16am UTC](https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780 "2017-12-31T05:16:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed.mo7ie](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.mo7ie](https://forum.dynamobim.com/u/mohamed.mo7ie)\
**Post date:** [December 31, 2017, 5:16am UTC](https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780/1 "2017-12-31T05:16:48Z")

</div>

I am facing confusion on getting the result i need in this replace item at index

i have 4 items in sublists in a list need to be replaced with lists…i know it is kinda confusing but may the pics can be more clear

 ![Replace](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/5/5546fb997617db36b329f85a34c5111d5722cf5b.JPG)

---

<div class="post-metadata">

**Author:** ![mohamed.mo7ie](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.mo7ie](https://forum.dynamobim.com/u/mohamed.mo7ie)\
**Post date:** [December 31, 2017, 12:46pm UTC](https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780/4 "2017-12-31T12:46:32Z")

</div>

A lot of thanks for your help,

i know it is very confusing, my condition is , i need not to have any arcs in my list so what i have done is took this arcs and divided it into lines, so what i need to do is remove these arcs (i have 4 in my whole list), and replace them with the newly created lines out of these arc divisions

i hope you can get my point and help me with this confusing issue

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/c/9c77a9f26496fe85b42371ef1e0481b973261c40.png)

---

<div class="post-metadata">

**Author:** ![mohamed.mo7ie](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.mo7ie](https://forum.dynamobim.com/u/mohamed.mo7ie)\
**Post date:** [December 31, 2017, 12:47pm UTC](https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780/5 "2017-12-31T12:47:57Z")

</div>

how can i really replace one item in a sublist by multiple elements…to remove the arc and put the 4 lines on its place

---

<div class="post-metadata">

**Author:** ![mohamed.mo7ie](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.mo7ie](https://forum.dynamobim.com/u/mohamed.mo7ie)\
**Post date:** [December 31, 2017, 12:50pm UTC](https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780/6 "2017-12-31T12:50:17Z")

</div>

in my script, the 23 is actually the index of the arc inside the 29 list , it is not a value or item…it is index

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/a/da69d682870fa0567b1a876af8293b6a85771710.jpg)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 31, 2017, 6:36pm UTC](https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780/7 "2017-12-31T18:36:01Z")

</div>

I would use an if statement to replace arcs in the original list with the list of lines.

ObjectTypeOfOriginalList==Arc?  
FunctionThatMakssLinesDrivenByArc:  
OriginalList

---

<div class="post-metadata">

**Author:** ![mohamed.mo7ie](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mohamed.mo7ie](https://forum.dynamobim.com/u/mohamed.mo7ie)\
**Post date:** [January 2, 2018, 4:50am UTC](https://forum.dynamobim.com/t/replace-a-list-instead-of-item-at-index-in-nested-list/17780/8 "2018-01-02T04:50:51Z")

</div>

IT would be the same issue, it is not about the condition at all its about the replacement
