# Code Block -reading list values

**URL:** <https://forum.dynamobim.com/t/code-block-reading-list-values/90048>\
**Category:** Civil 3D\
**Tags:** dynamo\
**Created:** [May 26, 2023, 7:58am UTC](https://forum.dynamobim.com/t/code-block-reading-list-values/90048 "2023-05-26T07:58:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DScad](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@DScad](https://forum.dynamobim.com/u/DScad)\
**Post date:** [May 26, 2023, 7:58am UTC](https://forum.dynamobim.com/t/code-block-reading-list-values/90048/1 "2023-05-26T07:58:16Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/0/f0522967b26ebb4c5452688ba25e5d999e34ac32.png)

Hi, I have a problem with a code block.  
If I take the individual readings from the list I get the correct values.  
If I use number generation within the specified range instead I get wrong readings. Since I have to read 226 values, how can I solve this ?

Thank you.

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 26, 2023, 8:05am UTC](https://forum.dynamobim.com/t/code-block-reading-list-values/90048/2 "2023-05-26T08:05:34Z")

</div>

@DScad ,

whats the error message ?

maybe you are out of range? or you have nulls ? or you are indexing wrong …

KR

Andreas

---

<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:** [May 26, 2023, 9:45am UTC](https://forum.dynamobim.com/t/code-block-reading-list-values/90048/3 "2023-05-26T09:45:18Z")

</div>

List.GetItemAtIndex should do the trick; might need two of them though.

---

<div class="post-metadata">

**Author:** ![DScad](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@DScad](https://forum.dynamobim.com/u/DScad)\
**Post date:** [May 26, 2023, 10:59am UTC](https://forum.dynamobim.com/t/code-block-reading-list-values/90048/4 "2023-05-26T10:59:51Z")

</div>

Thanks !!
