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 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()