From 38167af91633fb2e9455381abeab1c1828161ddb Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 30 Apr 2020 08:28:00 +1000 Subject: [PATCH] Fix section planes not cutting through aggregates and appearing at cursor --- src/ifcblenderexport/blenderbim/bim/operator.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ifcblenderexport/blenderbim/bim/operator.py b/src/ifcblenderexport/blenderbim/bim/operator.py index 9cbc8abbae..2e5e7a2141 100644 --- a/src/ifcblenderexport/blenderbim/bim/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/operator.py @@ -1921,6 +1921,7 @@ class AddSectionPlane(bpy.types.Operator): section.empty_display_type = 'SINGLE_ARROW' section.empty_display_size = 5 section.rotation_euler = Euler((radians(180.0), 0.0, 0.0), 'XYZ') + section.location = bpy.context.scene.cursor.location section.show_in_front = True collection = bpy.data.collections.get('Sections') if not collection: @@ -2018,11 +2019,15 @@ class AddSectionPlane(bpy.types.Operator): material.use_nodes = True if bpy.context.scene.BIMProperties.should_section_selected_objects: - objects = bpy.context.selected_objects + objects = list(bpy.context.selected_objects) else: - objects = bpy.context.visible_objects + objects = list(bpy.context.visible_objects) for obj in objects: + aggregate = obj.instance_collection + if aggregate and 'IfcRelAggregates/' in aggregate.name: + for part in aggregate.objects: + objects.append(part) if not (obj.data \ and hasattr(obj.data, 'materials') \ and obj.data.materials \