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'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.