mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 13:28:19 +00:00
New function to add ifc opening relationships
This commit is contained in:
@@ -3394,3 +3394,19 @@ class CalculateObjectVolumes(bpy.types.Operator):
|
||||
result += qto_calculator.get_volume(obj)
|
||||
bpy.context.scene.BIMProperties.qto_result = str(round(result, 3))
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class AddOpening(bpy.types.Operator):
|
||||
bl_idname = 'bim.add_opening'
|
||||
bl_label = 'Add Opening'
|
||||
|
||||
def execute(self, context):
|
||||
opening = context.active_object
|
||||
if context.selected_objects[0] != context.active_object:
|
||||
obj = context.selected_objects[0]
|
||||
else:
|
||||
obj = context.selected_objects[1]
|
||||
modifier = obj.modifiers.new('IfcOpeningElement', 'BOOLEAN')
|
||||
modifier.operation = 'DIFFERENCE'
|
||||
modifier.object = opening
|
||||
return {'FINISHED'}
|
||||
|
||||
Reference in New Issue
Block a user