From 0ba79dc105b320716315ef820ac71cecd143e146 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 2 May 2023 10:23:43 +1000 Subject: [PATCH] Accommodate space boundaries with no connection geometry, fetch spatial structure for IFC2X3, and fix scale bug when editing boundary profiles. --- src/blenderbim/blenderbim/bim/module/boundary/decorator.py | 2 +- src/blenderbim/blenderbim/bim/module/model/data.py | 5 ++++- src/blenderbim/blenderbim/tool/model.py | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/boundary/decorator.py b/src/blenderbim/blenderbim/bim/module/boundary/decorator.py index 9012bda523..360bdc6496 100644 --- a/src/blenderbim/blenderbim/bim/module/boundary/decorator.py +++ b/src/blenderbim/blenderbim/bim/module/boundary/decorator.py @@ -80,7 +80,7 @@ class BoundaryDecorator: for boundary in context.scene.BIMBoundaryProperties.boundaries: obj = boundary.obj - if not obj: + if not obj or not obj.data: # A boundary may not have data if it has no connection geometry continue if obj.mode == "EDIT": diff --git a/src/blenderbim/blenderbim/bim/module/model/data.py b/src/blenderbim/blenderbim/bim/module/model/data.py index d9ba12ae5e..20df6a7961 100644 --- a/src/blenderbim/blenderbim/bim/module/model/data.py +++ b/src/blenderbim/blenderbim/bim/module/model/data.py @@ -70,7 +70,10 @@ class AuthoringData: declarations = ifcopenshell.util.schema.get_subtypes(declaration) names = [d.name() for d in declarations] - declaration = tool.Ifc.schema().declaration_by_name("IfcSpatialElementType") + if tool.Ifc.get_schema() == "IFC2X3": + declaration = tool.Ifc.schema().declaration_by_name("IfcSpatialStructureElementType") + else: + declaration = tool.Ifc.schema().declaration_by_name("IfcSpatialElementType") declarations = ifcopenshell.util.schema.get_subtypes(declaration) names.extend([d.name() for d in declarations]) diff --git a/src/blenderbim/blenderbim/tool/model.py b/src/blenderbim/blenderbim/tool/model.py index ef475ce569..a8d8b4dc93 100644 --- a/src/blenderbim/blenderbim/tool/model.py +++ b/src/blenderbim/blenderbim/tool/model.py @@ -279,6 +279,10 @@ class Model(blenderbim.core.tool.Model): if surface.is_a("IfcCurveBoundedPlane"): position = Matrix(ifcopenshell.util.placement.get_axis2placement(surface.BasisSurface.Position).tolist()) + position[0][3] *= cls.unit_scale + position[1][3] *= cls.unit_scale + position[2][3] *= cls.unit_scale + cls.import_curve(obj, position, surface.OuterBoundary) for inner_boundary in surface.InnerBoundaries: cls.import_curve(obj, position, inner_boundary)