mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 00:46:36 +00:00
Fix bug where you couldn't filter imported subelements without also selecting their parents
This commit is contained in:
@@ -1042,6 +1042,8 @@ class IfcImporter:
|
||||
def create_aggregate_collections(self):
|
||||
if self.ifc_import_settings.has_filter:
|
||||
rel_aggregates = [e.IsDecomposedBy[0] for e in self.elements if e.IsDecomposedBy]
|
||||
rel_aggregates += [e.Decomposes[0] for e in self.elements if e.Decomposes]
|
||||
rel_aggregates = set(rel_aggregates)
|
||||
else:
|
||||
rel_aggregates = [a for a in self.file.by_type("IfcRelAggregates") if a.RelatingObject.is_a("IfcElement")]
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class CopyToContainer(bpy.types.Operator):
|
||||
self.file = IfcStore.get_file()
|
||||
objects = list(bpy.data.objects.get(self.obj, context.selected_objects))
|
||||
sprops = context.scene.BIMSpatialProperties
|
||||
container_ids = [c.ifc_definition_id for c in sprops.spatial_elements if c.is_selected]
|
||||
container_ids = [c.ifc_definition_id for c in sprops.containers if c.is_selected]
|
||||
for obj in objects:
|
||||
container = ifcopenshell.util.element.get_container(
|
||||
self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
|
||||
Reference in New Issue
Block a user