Fix bug where the pset templates with multiple applicable entities only checked the first entity

This commit is contained in:
Dion Moult
2021-08-25 17:22:02 +10:00
parent a430d356c0
commit 8fa1a99864
@@ -1,11 +1,11 @@
import pathlib
import re import re
import pathlib
import ifcopenshell
import ifcopenshell.util.schema
from ifcopenshell.entity_instance import entity_instance
from functools import lru_cache from functools import lru_cache
from typing import List, Generator, Optional from typing import List, Generator, Optional
import ifcopenshell
from ifcopenshell.entity_instance import entity_instance
templates = {} templates = {}
@@ -71,10 +71,8 @@ class PsetQto:
continue continue
applicable_class = match.group(1) applicable_class = match.group(1)
if entity.name() == applicable_class: if ifcopenshell.util.schema.is_a(entity, applicable_class):
return True return True
if entity.supertype():
return self.is_applicable(entity.supertype(), applicable_class)
return False return False
@lru_cache() @lru_cache()