Support type-based class checking for converting IFC2X3 models to Brickschema

This commit is contained in:
Dion Moult
2022-01-12 15:39:43 +11:00
parent 92642e6a6a
commit 39960998de
4 changed files with 28 additions and 19 deletions
+1 -4
View File
@@ -85,10 +85,7 @@ def add_brick_feed(ifc, brick, source=None, destination=None):
def convert_ifc_to_brick(brick, namespace=None, library=None):
for obj, element in brick.get_convertable_brick_objects_and_elements():
brick_class = brick.get_brick_class(element)
if not brick_class:
continue
brick_uri = brick.add_brick(element, namespace, brick_class)
brick_uri = brick.add_brick(element, namespace, brick.get_brick_class(element))
if library:
brick.run_assign_brick_reference(obj=obj, library=library, brick_uri=brick_uri)
brick.run_refresh_brick_viewer()
-6
View File
@@ -150,12 +150,6 @@ class TestConvertIfcToBrick:
brick.run_refresh_brick_viewer().should_be_called()
subject.convert_ifc_to_brick(brick, namespace="namespace", library="library")
def test_not_converting_an_element_where_we_cannot_find_the_corresponding_brick_class(self, brick):
brick.get_convertable_brick_objects_and_elements().should_be_called().will_return([("obj", "element")])
brick.get_brick_class("element").should_be_called().will_return(None)
brick.run_refresh_brick_viewer().should_be_called()
subject.convert_ifc_to_brick(brick, namespace="namespace", library="library")
class TestNewBrickFile:
def test_run(self, brick):