2026-08-03 15:44:33 +05:00
|
|
|
import ifcopenshell
|
2026-08-03 16:07:29 +05:00
|
|
|
from generate import normalize_header
|
2026-08-03 15:44:33 +05:00
|
|
|
|
|
|
|
|
cases = (
|
|
|
|
|
("pass", "label-values", ("test1", "test2")),
|
|
|
|
|
("pass", "nil-values", None),
|
|
|
|
|
("fail", "distinct-value-types", ("test1", 2)),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for result, name, values in cases:
|
|
|
|
|
ifc_file = ifcopenshell.file(schema="IFC4X3")
|
|
|
|
|
list_values = None
|
|
|
|
|
if values is not None:
|
|
|
|
|
list_values = [
|
|
|
|
|
ifc_file.create_entity("IfcInteger", v) if isinstance(v, int) else ifc_file.create_entity("IfcLabel", v)
|
|
|
|
|
for v in values
|
|
|
|
|
]
|
|
|
|
|
ifc_file.create_entity("IfcPropertyListValue", Name="Test", ListValues=list_values)
|
2026-08-03 16:07:29 +05:00
|
|
|
normalize_header(ifc_file)
|
2026-08-03 15:44:33 +05:00
|
|
|
ifc_file.write(f"{result}-property-list-value-{name}.ifc")
|