mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 09:18:38 +00:00
Support type-based class checking for converting IFC2X3 models to Brickschema
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user