mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-29 11:46:33 +00:00
Report exceptions about spatial structure
This commit is contained in:
@@ -308,7 +308,11 @@ class IfcExporter():
|
|||||||
|
|
||||||
def create_products(self):
|
def create_products(self):
|
||||||
for product in self.ifc_parser.products:
|
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,
|
placement = self.file.createIfcLocalPlacement(placement_rel_to,
|
||||||
self.create_ifc_axis_2_placement_3d(product['raw'].location))
|
self.create_ifc_axis_2_placement_3d(product['raw'].location))
|
||||||
representation = self.file.createIfcProductDefinitionShape(
|
representation = self.file.createIfcProductDefinitionShape(
|
||||||
|
|||||||
Reference in New Issue
Block a user