You can now set a fixed RL for inserted windows

This commit is contained in:
Dion Moult
2022-10-09 23:29:06 +11:00
parent 278931f5db
commit 492a535312
3 changed files with 11 additions and 1 deletions
@@ -44,6 +44,8 @@ class AddFilledOpening(bpy.types.Operator, tool.Ifc.Operator):
filling_obj: bpy.props.StringProperty()
def _execute(self, context):
props = context.scene.BIMModelProperties
voided_obj = bpy.data.objects.get(self.voided_obj)
filling_obj = bpy.data.objects.get(self.filling_obj)
filling = tool.Ifc.get_entity(filling_obj)
@@ -66,7 +68,11 @@ class AddFilledOpening(bpy.types.Operator, tool.Ifc.Operator):
new_matrix = voided_obj.matrix_world.copy()
new_matrix.col[3] = tool.Cad.point_on_edge(target, axis).to_4d()
if not filling.is_a("IfcDoor"):
new_matrix[2][3] = target[2]
container = ifcopenshell.util.element.get_container(element)
if container:
container_obj = tool.Ifc.get_object(container)
if container_obj:
new_matrix[2][3] = container_obj.matrix_world[2][3] + props.rl
filling_obj.matrix_world = new_matrix
bpy.context.view_layer.update()
@@ -203,3 +203,4 @@ class BIMModelProperties(PropertyGroup):
x: bpy.props.FloatProperty(name="X", default=0.5)
y: bpy.props.FloatProperty(name="Y", default=0.5)
z: bpy.props.FloatProperty(name="Z", default=0.5)
rl: bpy.props.FloatProperty(name="RL", default=1)
@@ -219,6 +219,9 @@ class BimTool(WorkSpaceTool):
row.operator("bim.extend_profile", icon="X", text="").join_type = ""
if ifc_class in ("IfcWindowType", "IfcDoorType"):
row = layout.row(align=True)
row.prop(data=props, property="rl", text="RL")
row = layout.row(align=True)
row.label(text="", icon="EVENT_SHIFT")
row.label(text="", icon="EVENT_G")