From 8fa1a99864c8b2723f7e87ac3cbab303d1944a3d Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 25 Aug 2021 17:22:02 +1000 Subject: [PATCH] Fix bug where the pset templates with multiple applicable entities only checked the first entity --- src/ifcopenshell-python/ifcopenshell/util/pset.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/pset.py b/src/ifcopenshell-python/ifcopenshell/util/pset.py index 1f6bf735bb..da63a46fe9 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/pset.py +++ b/src/ifcopenshell-python/ifcopenshell/util/pset.py @@ -1,11 +1,11 @@ -import pathlib import re +import pathlib +import ifcopenshell +import ifcopenshell.util.schema +from ifcopenshell.entity_instance import entity_instance from functools import lru_cache from typing import List, Generator, Optional -import ifcopenshell -from ifcopenshell.entity_instance import entity_instance - templates = {} @@ -71,10 +71,8 @@ class PsetQto: continue applicable_class = match.group(1) - if entity.name() == applicable_class: + if ifcopenshell.util.schema.is_a(entity, applicable_class): return True - if entity.supertype(): - return self.is_applicable(entity.supertype(), applicable_class) return False @lru_cache()