diff --git a/src/blenderbim/blenderbim/tool/search.py b/src/blenderbim/blenderbim/tool/search.py index 55387c16fc..cbad2ac02e 100644 --- a/src/blenderbim/blenderbim/tool/search.py +++ b/src/blenderbim/blenderbim/tool/search.py @@ -209,7 +209,7 @@ class ImportFilterQueryTransformer(lark.Transformer): return ( is_not + { - "equals": "", # Blank because it's the default situation + "equals": "=" if is_not else "", # Blank because it's the default situation "morethanequalto": ">=", "lessthanequalto": "<=", "morethan": ">", diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py index baad3b9b11..4f6ead203b 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/element.py +++ b/src/ifcopenshell-python/ifcopenshell/util/element.py @@ -93,13 +93,13 @@ def get_pset( elif qtos_only and not pset.is_a("IfcElementQuantity"): pset = None - if type_pset: + if type_pset is not None: if psets_only and not type_pset.is_a("IfcPropertySet"): type_pset = None elif qtos_only and not type_pset.is_a("IfcElementQuantity"): type_pset = None - if not pset and not type_pset: + if not pset and type_pset is None: return if not prop: diff --git a/src/ifcopenshell-python/test/util/test_element.py b/src/ifcopenshell-python/test/util/test_element.py index 15da366d17..7d938eb2bc 100644 --- a/src/ifcopenshell-python/test/util/test_element.py +++ b/src/ifcopenshell-python/test/util/test_element.py @@ -68,6 +68,9 @@ class TestGetPsetIFC4(test.bootstrap.IFC4): assert subject.get_pset(element, "name", "a") == 2 assert subject.get_pset(element, "name", "x") == 1 assert subject.get_pset(element, "name", "b") == 3 + pset = ifcopenshell.api.run("pset.add_pset", self.file, product=type_element, name="name2") + ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"z": False}) + assert subject.get_pset(element, "name2", "z") is False def test_excluding_inherited_psets(self): element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")