get level dynamo revit
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
#Preparing input from dynamo to revit
names = IN[0]
#Do some action in a Transaction
levels = []
fec = FilteredElementCollector(doc).OfClass(Level).ToElements()
for l in fec:
for n in names:
if l.Name == n:
levels.Add(l)
OUT = levels