Minor fix

This commit is contained in:
Dion Moult
2021-11-05 12:20:33 +11:00
parent 04449d08e8
commit 657aafbd2e
3 changed files with 38 additions and 5 deletions
@@ -393,6 +393,7 @@ class OverrideDelete(bpy.types.Operator):
elif getattr(element, "HasOpenings", None):
for rel in element.HasOpenings:
self.delete_opening_element(rel.RelatedOpeningElement)
IfcStore.deleted_ids.add(element.id())
bpy.data.objects.remove(obj)
return {"FINISHED"}
+24
View File
@@ -0,0 +1,24 @@
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix bsh: <https://brickschema.org/schema/BrickShape#> .
@prefix dcterms: <http://purl.org/dc/terms#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix qudtqk: <http://qudt.org/vocab/quantitykind/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sdo: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix tag: <https://brickschema.org/schema/BrickTag#> .
@prefix unit: <http://qudt.org/vocab/unit/> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
brick:Class a owl:Class .
brick:Location a owl:Class ;
rdfs:subClassOf brick:Class .
brick:Building a owl:Class ;
rdfs:subClassOf brick:Class, brick:Location .
+13 -5
View File
@@ -18,6 +18,7 @@
import os
import bpy
import brickschema
import ifcopenshell
import blenderbim.core.tool
import blenderbim.tool as tool
@@ -70,13 +71,13 @@ class TestImportBrickClasses(NewFile):
subject.import_brick_classes("Class")
assert len(bpy.context.scene.BIMBrickProperties.bricks) == 2
brick = bpy.context.scene.BIMBrickProperties.bricks[0]
assert brick.name == "Building"
assert brick.uri == "https://brickschema.org/schema/Brick#Building"
assert brick.total_items == 1
brick = bpy.context.scene.BIMBrickProperties.bricks[1]
assert brick.name == "Location"
assert brick.uri == "https://brickschema.org/schema/Brick#Location"
assert brick.total_items == 7
brick = bpy.context.scene.BIMBrickProperties.bricks[1]
assert brick.name == "Measurable"
assert brick.uri == "https://brickschema.org/schema/Brick#Measurable"
assert brick.total_items == 142
assert brick.total_items == 1
class TestImportBrickItems(NewFile):
@@ -92,6 +93,13 @@ class TestImportBrickItems(NewFile):
class TestLoadBrickFile(NewFile):
def test_run(self):
# We stub the schema to make tests run faster
BrickStore.schema = brickschema.Graph()
cwd = os.path.dirname(os.path.realpath(__file__))
schema_path = os.path.join(cwd, "..", "files", "BrickStub.ttl")
BrickStore.schema.load_file(schema_path)
# This is the actual test
cwd = os.path.dirname(os.path.realpath(__file__))
filepath = os.path.join(cwd, "..", "files", "spaces.ttl")
subject.load_brick_file(filepath)