mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Minor fix
This commit is contained in:
@@ -393,6 +393,7 @@ class OverrideDelete(bpy.types.Operator):
|
|||||||
elif getattr(element, "HasOpenings", None):
|
elif getattr(element, "HasOpenings", None):
|
||||||
for rel in element.HasOpenings:
|
for rel in element.HasOpenings:
|
||||||
self.delete_opening_element(rel.RelatedOpeningElement)
|
self.delete_opening_element(rel.RelatedOpeningElement)
|
||||||
|
IfcStore.deleted_ids.add(element.id())
|
||||||
bpy.data.objects.remove(obj)
|
bpy.data.objects.remove(obj)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|||||||
@@ -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 .
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import bpy
|
import bpy
|
||||||
|
import brickschema
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import blenderbim.core.tool
|
import blenderbim.core.tool
|
||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
@@ -70,13 +71,13 @@ class TestImportBrickClasses(NewFile):
|
|||||||
subject.import_brick_classes("Class")
|
subject.import_brick_classes("Class")
|
||||||
assert len(bpy.context.scene.BIMBrickProperties.bricks) == 2
|
assert len(bpy.context.scene.BIMBrickProperties.bricks) == 2
|
||||||
brick = bpy.context.scene.BIMBrickProperties.bricks[0]
|
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.name == "Location"
|
||||||
assert brick.uri == "https://brickschema.org/schema/Brick#Location"
|
assert brick.uri == "https://brickschema.org/schema/Brick#Location"
|
||||||
assert brick.total_items == 7
|
assert brick.total_items == 1
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
class TestImportBrickItems(NewFile):
|
class TestImportBrickItems(NewFile):
|
||||||
@@ -92,6 +93,13 @@ class TestImportBrickItems(NewFile):
|
|||||||
|
|
||||||
class TestLoadBrickFile(NewFile):
|
class TestLoadBrickFile(NewFile):
|
||||||
def test_run(self):
|
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__))
|
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||||
filepath = os.path.join(cwd, "..", "files", "spaces.ttl")
|
filepath = os.path.join(cwd, "..", "files", "spaces.ttl")
|
||||||
subject.load_brick_file(filepath)
|
subject.load_brick_file(filepath)
|
||||||
|
|||||||
Reference in New Issue
Block a user