Simplify unnecessary code to get representations

This commit is contained in:
Dion Moult
2019-09-04 11:58:18 +10:00
parent 1dff84ace3
commit 684e687b6a
+3 -6
View File
@@ -185,17 +185,14 @@ class IfcParser():
return elements return elements
def get_representations(self): def get_representations(self):
representations = {} results = []
for object in self.selected_products + self.selected_types: for object in self.selected_products + self.selected_types:
if not object.data: if not object.data:
continue continue
representations[object.data.name] = object.data
results = []
for name, value in representations.items():
results.append({ results.append({
'ifc': None, 'ifc': None,
'raw': value, 'raw': object.data,
'attributes': { 'Name': name } 'attributes': { 'Name': object.data.name }
}) })
return results return results