fix assigning material usages / reloading reprs after c4ae9578e #4843

This commit is contained in:
Andrej730
2024-06-25 17:46:42 +05:00
parent ef9bbd8de6
commit f364643d7e
5 changed files with 33 additions and 3 deletions
@@ -27,7 +27,7 @@ from typing import Optional, Union
def assign_material(
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
type: str = "IfcMaterial",
type: ifcopenshell.util.element.MATERIAL_TYPE = "IfcMaterial",
material: Optional[ifcopenshell.entity_instance] = None,
) -> Union[ifcopenshell.entity_instance, list[ifcopenshell.entity_instance], None]:
"""Assigns a material to the list of products
@@ -23,6 +23,17 @@ from typing import Any, Callable, Optional, Union, Literal, overload
from collections import namedtuple
MATERIAL_TYPE = Literal[
"IfcMaterial",
"IfcMaterialConstituentSet",
"IfcMaterialLayerSet",
"IfcMaterialLayerSetUsage",
"IfcMaterialProfileSet",
"IfcMaterialProfileSetUsage",
"IfcMaterialList",
]
def get_pset(
element: ifcopenshell.entity_instance,
name: str,