mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +00:00
Fix bug where all grouped annotations were excluded when opening models, whereas we only want drawing annotations to be excluded.
This commit is contained in:
@@ -327,13 +327,19 @@ class IfcImporter:
|
|||||||
if isinstance(self.elements, set):
|
if isinstance(self.elements, set):
|
||||||
self.elements = list(self.elements)
|
self.elements = list(self.elements)
|
||||||
# TODO: enable filtering for annotations
|
# TODO: enable filtering for annotations
|
||||||
self.annotations = set([a for a in self.file.by_type("IfcAnnotation") if not a.HasAssignments])
|
|
||||||
else:
|
else:
|
||||||
if self.file.schema in ("IFC2X3", "IFC4"):
|
if self.file.schema in ("IFC2X3", "IFC4"):
|
||||||
self.elements = self.file.by_type("IfcElement") + self.file.by_type("IfcProxy")
|
self.elements = self.file.by_type("IfcElement") + self.file.by_type("IfcProxy")
|
||||||
else:
|
else:
|
||||||
self.elements = self.file.by_type("IfcElement")
|
self.elements = self.file.by_type("IfcElement")
|
||||||
self.annotations = set([a for a in self.file.by_type("IfcAnnotation") if not a.HasAssignments])
|
|
||||||
|
drawing_groups = [g for g in self.file.by_type("IfcGroup") if g.ObjectType == "DRAWING"]
|
||||||
|
drawing_annotations = set()
|
||||||
|
for drawing_group in drawing_groups:
|
||||||
|
for rel in drawing_group.IsGroupedBy:
|
||||||
|
drawing_annotations.update(rel.RelatedObjects)
|
||||||
|
self.annotations = set([a for a in self.file.by_type("IfcAnnotation")])
|
||||||
|
self.annotations -= drawing_annotations
|
||||||
|
|
||||||
self.elements = [e for e in self.elements if not e.is_a("IfcFeatureElement")]
|
self.elements = [e for e in self.elements if not e.is_a("IfcFeatureElement")]
|
||||||
if self.ifc_import_settings.is_coordinating:
|
if self.ifc_import_settings.is_coordinating:
|
||||||
|
|||||||
Reference in New Issue
Block a user