Accommodate space boundaries with no connection geometry, fetch spatial structure for IFC2X3, and fix scale bug when editing boundary profiles.

This commit is contained in:
Dion Moult
2023-05-02 10:23:43 +10:00
parent 52c686b656
commit 0ba79dc105
3 changed files with 9 additions and 2 deletions
@@ -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":
@@ -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])
+4
View File
@@ -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)