I use if isinstance(ins,list): to check . but it returned false Although ins is the List[Object]
def getname(ins):
name=[]
if isinstance(ins,list):
for i in ins:
name.append(i.Name)
else:
name.append(ins.Name)
return name
Levels = FilteredElementCollector(doc).OfClass(Level).ToElements()
ULevels = UnwrapElement(Levels)
Levelsname = getname(ULevels)
Error message is:
AttributeError: 'List[object]' object has no attribute 'Name'