Put In python a list of reference

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

sorry this is the script

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!