File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import ifcopenshell .util .element
3030import ifcopenshell .util .placement
3131import ifcopenshell .util .classification
32+ import ifcopenshell .util .selector
3233from deepdiff import DeepDiff
3334
3435
@@ -50,8 +51,13 @@ def diff(self):
5051
5152 self .precision = self .get_precision ()
5253
53- old_elements = set (e .GlobalId for e in self .old .by_type ("IfcProduct" ))
54- new_elements = set (e .GlobalId for e in self .new .by_type ("IfcProduct" ))
54+ if self .filter_elements :
55+ selector = ifcopenshell .util .selector .Selector ()
56+ old_elements = set (e .GlobalId for e in selector .parse (self .old , self .filter_elements ))
57+ new_elements = set (e .GlobalId for e in selector .parse (self .new , self .filter_elements ))
58+ else :
59+ old_elements = set (e .GlobalId for e in self .old .by_type ("IfcProduct" ))
60+ new_elements = set (e .GlobalId for e in self .new .by_type ("IfcProduct" ))
5561
5662 self .deleted_elements = old_elements - new_elements
5763 self .added_elements = new_elements - old_elements
You can’t perform that action at this time.
0 commit comments