Report exceptions about spatial structure

This commit is contained in:
Dion Moult
2019-09-02 19:43:11 +10:00
parent 46c5cd4ee2
commit 3490b1b388
+5 -1
View File
@@ -308,7 +308,11 @@ class IfcExporter():
def create_products(self):
for product in self.ifc_parser.products:
placement_rel_to = self.ifc_parser.spatial_structure_elements[product['relating_structure']]['ifc'].ObjectPlacement
try:
placement_rel_to = self.ifc_parser.spatial_structure_elements[product['relating_structure']]['ifc'].ObjectPlacement
except Exception as e:
print('The product "{}/{}" could not be placed on a spatial structure {}'.format(product['class'], product['attributes']['Name'], e.args))
continue
placement = self.file.createIfcLocalPlacement(placement_rel_to,
self.create_ifc_axis_2_placement_3d(product['raw'].location))
representation = self.file.createIfcProductDefinitionShape(