# Put In python a list of reference

**URL:** <https://forum.dynamobim.com/t/put-in-python-a-list-of-reference/89057>\
**Category:** Uncategorized\
**Created:** [April 28, 2023, 11:08am UTC](https://forum.dynamobim.com/t/put-in-python-a-list-of-reference/89057 "2023-04-28T11:08:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paolo.campana](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@paolo.campana](https://forum.dynamobim.com/u/paolo.campana)\
**Post date:** [April 28, 2023, 11:08am UTC](https://forum.dynamobim.com/t/put-in-python-a-list-of-reference/89057/1 "2023-04-28T11:08:21Z")

</div>

Hi All,  
i’m trying to put on a list of model line a slab edge, i’m finding something like this on forum but it works for a single model line i can’t use the list as input.  
Somoone can give me an hand…  
Thanks

this is he code

import clr

clr.AddReference(“RevitNodes”)  
import Revit  
clr.ImportExtensions(Revit.Elements)  
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference(“RevitServices”)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager

clr.AddReference(“RevitAPI”)  
import Autodesk  
from Autodesk.Revit.DB import \*

clr.AddReference(‘RevitAPIUI’)  
from Autodesk.Revit.UI import \*

doc = DocumentManager.Instance.CurrentDBDocument

TransactionManager.Instance.EnsureInTransaction(doc)

edgeType = UnwrapElement(IN[0])  
Reference = IN[1]

SlabEdge = doc.Create.NewSlabEdge(edgeType, Reference)

TransactionManager. Instance.TransactionTaskDone()

OUT = SlabEdge

---

<div class="post-metadata">

**Author:** ![paolo.campana](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@paolo.campana](https://forum.dynamobim.com/u/paolo.campana)\
**Post date:** [April 28, 2023, 11:09am UTC](https://forum.dynamobim.com/t/put-in-python-a-list-of-reference/89057/2 "2023-04-28T11:09:03Z")

</div>

![dynamo script](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/9/b901bb61971a095e415e4e88da731ce828616dcc.jpeg)

sorry this is the script

---

<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:** [April 28, 2023, 11:35am UTC](https://forum.dynamobim.com/t/put-in-python-a-list-of-reference/89057/3 "2023-04-28T11:35:18Z")

</div>

Do you want one slab edge using all the lines, or a new slab edge for each line?

For the later you need to add a for loop to iterate over the list of edges, or utilize some list comprehension. A quick Google search will give directions on either of those methods, and you can then implement it on your own. Personally I would use a for loop here.

For a single slab edge with multiple curves you will first need to create a reference array (`refArray = ReferenceArray()`) and then append each of the curves into that in a loop. This will append one curve `refArray.Append(reference)`. You will need to implement a for loop or list comprehension for that to utilize all the references. I would also use a for loop here. From there you’ll be able to use the reference array to generate the slab edge, as that method is quite similar to your previous one `slabEdge = doc.Create.NewSlabEdge(edgeType, refArray)`.

Give it a shot and let us know where you get!
