mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 08:38:39 +00:00
rule fixtures: add missing generation scripts
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
import ifcopenshell
|
||||||
|
|
||||||
|
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)
|
||||||
|
ifc_file.write(f"{result}-property-list-value-{name}.ifc")
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import ifcopenshell
|
||||||
|
|
||||||
|
ifc_file = ifcopenshell.file(schema="IFC2X3")
|
||||||
|
ifc_file.create_entity(
|
||||||
|
"IfcCurveStyle",
|
||||||
|
CurveWidth=ifc_file.create_entity("IfcDescriptiveMeasure", "by layer"),
|
||||||
|
)
|
||||||
|
ifc_file.write("pass-IfcCurveStyle-ifc2x3.ifc")
|
||||||
Reference in New Issue
Block a user