mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix bug where you couldn't add conditional material psets
This commit is contained in:
@@ -70,10 +70,14 @@ class Pset(bonsai.core.tool.Pset):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_pset_applicable(cls, element: ifcopenshell.entity_instance, pset_name: str) -> bool:
|
def is_pset_applicable(cls, element: ifcopenshell.entity_instance, pset_name: str) -> bool:
|
||||||
|
if element.is_a("IfcMaterialDefinition"):
|
||||||
|
predefined_type = getattr(element, "Category", None)
|
||||||
|
else:
|
||||||
|
predefined_type = ifcopenshell.util.element.get_predefined_type(element)
|
||||||
return bool(
|
return bool(
|
||||||
pset_name
|
pset_name
|
||||||
in bonsai.bim.schema.ifc.psetqto.get_applicable_names(
|
in bonsai.bim.schema.ifc.psetqto.get_applicable_names(
|
||||||
element.is_a(), ifcopenshell.util.element.get_predefined_type(element), pset_only=True
|
element.is_a(), predefined_type, pset_only=True
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user