# List iteration | converting a revit point list to dynamo point list

**URL:** <https://forum.dynamobim.com/t/list-iteration-converting-a-revit-point-list-to-dynamo-point-list/95941>\
**Category:** Lists-Logic\
**Created:** [November 29, 2023, 6:12pm UTC](https://forum.dynamobim.com/t/list-iteration-converting-a-revit-point-list-to-dynamo-point-list/95941 "2023-11-29T18:12:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ecenurc](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ecenurc/32/177701_2.png) [@Ecenurc](https://forum.dynamobim.com/u/Ecenurc)\
**Post date:** [November 29, 2023, 6:12pm UTC](https://forum.dynamobim.com/t/list-iteration-converting-a-revit-point-list-to-dynamo-point-list/95941/1 "2023-11-29T18:12:12Z")

</div>

Hi,  
I wanted to convert my Revit.DB.Point list to dynamo point list.

The list I am trying to iterate is this.

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

I get the list length connected to IN[1].

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

> **List iteration**
>
> ```auto
> # Load the Python Standard and DesignScript Libraries
> import sys
> import clr
> clr.AddReference('ProtoGeometry')
> from Autodesk.DesignScript.Geometry import *
> 
> # Import RevitAPI
> clr.AddReference("RevitAPI")
> import Autodesk
> from Autodesk.Revit.DB import *
> 
> # The inputs to this node will be stored as a list in the IN variables.
> revit_xyz=IN[0]
> pointlist_ListCount=IN[1]
> 
> # Place your code below this line
> i=0
> outputList=[]
> 
> for i in range(pointlist_ListCount):
> outputList.append(revit_xyz.ToPoint()) # I get error here.I can't get any attribute. 
> i=i+1
> 
> # Assign your output to the OUT variable.
> OUT = outputList
> 
> ```

I get this error: on this line of the code [outputList.append(revit\_xyz.ToPoint())] - AttributeError: ‘list’ object has no attribute 'To Point"

Could you please help me finding my mistake here?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 29, 2023, 6:25pm UTC](https://forum.dynamobim.com/t/list-iteration-converting-a-revit-point-list-to-dynamo-point-list/95941/2 "2023-11-29T18:25:45Z")

</div>

You’re still converting the whole list inside your loop. If `i` is your index, then you need to get the item at that index every time with `revit_xyz[i].ToPoint()`.

For a simpler solution, you can just use a `for` loop, which is specifically for iterating over items in a list:

```auto
for xyz in revit_xyz:
    outputList.append(xyz.ToPoint())

```

This will iterate over each point (`xyz`) in your list (`revit_xyz`) and allow you to interact with that item specifically.

---

<div class="post-metadata">

**Author:** ![Ecenurc](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ecenurc/32/177701_2.png) [@Ecenurc](https://forum.dynamobim.com/u/Ecenurc)\
**Post date:** [November 29, 2023, 6:30pm UTC](https://forum.dynamobim.com/t/list-iteration-converting-a-revit-point-list-to-dynamo-point-list/95941/3 "2023-11-29T18:30:25Z")

</div>

thank you very much, I spent so much time to find a solution and kept looking at the sites to see an example (although there are many) I couldn’t do it. I really appreciated!
