diff --git a/src/blenderbim/blenderbim/bim/module/boundary/operator.py b/src/blenderbim/blenderbim/bim/module/boundary/operator.py index 23db0e03e2..2c2b0b63e9 100644 --- a/src/blenderbim/blenderbim/bim/module/boundary/operator.py +++ b/src/blenderbim/blenderbim/bim/module/boundary/operator.py @@ -618,7 +618,7 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator): surface = tool.Model.export_surface(obj) connection_geometry = tool.Ifc.get().createIfcConnectionSurfaceGeometry(surface) - boundary = tool.Ifc.run("root.create_entity", ifc_class="IfcRelSpaceBoundary") + boundary = tool.Ifc.run("root.create_entity", ifc_class=context.scene.BIMModelProperties.boundary_class) boundary.RelatingSpace = relating_space boundary.RelatedBuildingElement = related_building_element boundary.ConnectionGeometry = connection_geometry diff --git a/src/blenderbim/blenderbim/bim/module/model/data.py b/src/blenderbim/blenderbim/bim/module/model/data.py index 20df6a7961..0b0225e539 100644 --- a/src/blenderbim/blenderbim/bim/module/model/data.py +++ b/src/blenderbim/blenderbim/bim/module/model/data.py @@ -63,6 +63,15 @@ class AuthoringData: cls.data["active_class"] = cls.active_class() cls.data["active_material_usage"] = cls.active_material_usage() cls.data["active_representation_type"] = cls.active_representation_type() + cls.data["boundary_class"] = cls.boundary_class() + + @classmethod + def boundary_class(cls): + declaration = tool.Ifc.schema().declaration_by_name("IfcRelSpaceBoundary") + declarations = ifcopenshell.util.schema.get_subtypes(declaration) + names = [d.name() for d in declarations] + version = tool.Ifc.get_schema() + return [(c, c, get_entity_doc(version, c).get("description", "")) for c in sorted(names)] @classmethod def type_class(cls): diff --git a/src/blenderbim/blenderbim/bim/module/model/prop.py b/src/blenderbim/blenderbim/bim/module/model/prop.py index 624d9aa59c..3affc647e2 100644 --- a/src/blenderbim/blenderbim/bim/module/model/prop.py +++ b/src/blenderbim/blenderbim/bim/module/model/prop.py @@ -37,6 +37,12 @@ def get_type_class(self, context): return AuthoringData.data["type_class"] +def get_boundary_class(self, context): + if not AuthoringData.is_loaded: + AuthoringData.load() + return AuthoringData.data["boundary_class"] + + def get_relating_type_id(self, context): if not AuthoringData.is_loaded: AuthoringData.load() @@ -141,6 +147,7 @@ class BIMModelProperties(PropertyGroup): type_class: bpy.props.EnumProperty(items=get_type_class, name="IFC Class", update=update_type_class) type_predefined_type: bpy.props.EnumProperty(items=get_type_predefined_type, name="Predefined Type", default=None) type_name: bpy.props.StringProperty(name="Name", default="TYPEX") + boundary_class: bpy.props.EnumProperty(items=get_boundary_class, name="Boundary Class") class BIMArrayProperties(PropertyGroup): diff --git a/src/blenderbim/blenderbim/bim/module/model/workspace.py b/src/blenderbim/blenderbim/bim/module/model/workspace.py index c65750e50e..05cf6ec358 100644 --- a/src/blenderbim/blenderbim/bim/module/model/workspace.py +++ b/src/blenderbim/blenderbim/bim/module/model/workspace.py @@ -262,11 +262,6 @@ class BimToolUI: else: row.operator("bim.add_potential_opening", text="Add Void") - row = cls.layout.row(align=True) - row.label(text="", icon="EVENT_SHIFT") - row.label(text="", icon="EVENT_B") - row.operator("bim.add_boundary", text="Add Boundary") - if AuthoringData.data["is_voidable_element"]: if AuthoringData.data["has_visible_openings"]: row.operator("bim.edit_openings", icon="CHECKMARK", text="") @@ -274,6 +269,12 @@ class BimToolUI: else: row.operator("bim.show_openings", icon="HIDE_OFF", text="") + row = cls.layout.row(align=True) + row.label(text="", icon="EVENT_SHIFT") + row.label(text="", icon="EVENT_B") + row.prop(cls.props, "boundary_class", text="") + row.operator("bim.add_boundary", text="Add Boundary") + cls.layout.row(align=True).label(text="Align") add_layout_hotkey_operator(cls.layout, "Align Exterior", "S_X", "") add_layout_hotkey_operator(cls.layout, "Align Centerline", "S_C", "")