mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
See #1676. You can now set the type of boundary class prior to generating boundaries.
This commit is contained in:
@@ -618,7 +618,7 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
surface = tool.Model.export_surface(obj)
|
surface = tool.Model.export_surface(obj)
|
||||||
connection_geometry = tool.Ifc.get().createIfcConnectionSurfaceGeometry(surface)
|
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.RelatingSpace = relating_space
|
||||||
boundary.RelatedBuildingElement = related_building_element
|
boundary.RelatedBuildingElement = related_building_element
|
||||||
boundary.ConnectionGeometry = connection_geometry
|
boundary.ConnectionGeometry = connection_geometry
|
||||||
|
|||||||
@@ -63,6 +63,15 @@ class AuthoringData:
|
|||||||
cls.data["active_class"] = cls.active_class()
|
cls.data["active_class"] = cls.active_class()
|
||||||
cls.data["active_material_usage"] = cls.active_material_usage()
|
cls.data["active_material_usage"] = cls.active_material_usage()
|
||||||
cls.data["active_representation_type"] = cls.active_representation_type()
|
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
|
@classmethod
|
||||||
def type_class(cls):
|
def type_class(cls):
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ def get_type_class(self, context):
|
|||||||
return AuthoringData.data["type_class"]
|
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):
|
def get_relating_type_id(self, context):
|
||||||
if not AuthoringData.is_loaded:
|
if not AuthoringData.is_loaded:
|
||||||
AuthoringData.load()
|
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_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_predefined_type: bpy.props.EnumProperty(items=get_type_predefined_type, name="Predefined Type", default=None)
|
||||||
type_name: bpy.props.StringProperty(name="Name", default="TYPEX")
|
type_name: bpy.props.StringProperty(name="Name", default="TYPEX")
|
||||||
|
boundary_class: bpy.props.EnumProperty(items=get_boundary_class, name="Boundary Class")
|
||||||
|
|
||||||
|
|
||||||
class BIMArrayProperties(PropertyGroup):
|
class BIMArrayProperties(PropertyGroup):
|
||||||
|
|||||||
@@ -262,11 +262,6 @@ class BimToolUI:
|
|||||||
else:
|
else:
|
||||||
row.operator("bim.add_potential_opening", text="Add Void")
|
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["is_voidable_element"]:
|
||||||
if AuthoringData.data["has_visible_openings"]:
|
if AuthoringData.data["has_visible_openings"]:
|
||||||
row.operator("bim.edit_openings", icon="CHECKMARK", text="")
|
row.operator("bim.edit_openings", icon="CHECKMARK", text="")
|
||||||
@@ -274,6 +269,12 @@ class BimToolUI:
|
|||||||
else:
|
else:
|
||||||
row.operator("bim.show_openings", icon="HIDE_OFF", text="")
|
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")
|
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 Exterior", "S_X", "")
|
||||||
add_layout_hotkey_operator(cls.layout, "Align Centerline", "S_C", "")
|
add_layout_hotkey_operator(cls.layout, "Align Centerline", "S_C", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user