Files
IfcOpenShell/src/ifcopenshell-python/test/fixtures/rules/generate_17.py
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
1.1 KiB
Python
Raw Normal View History

2023-01-11 12:48:53 +01:00
import time
2025-12-19 18:53:04 +05:00
2023-01-11 12:48:53 +01:00
import ifcopenshell
for i, nm in enumerate(("no-mls", "mls", "mlsu")):
f = ifcopenshell.file(schema="IFC2X3")
p = f.createIfcPerson(Id="tfk", GivenName="Thomas")
o = f.createIfcOrganization(Name="AECgeeks")
pando = f.createIfcPersonAndOrganization(p, o)
appl = f.createIfcApplication(o, ifcopenshell.version, "IfcOpenShell", f"IfcOpenShell {ifcopenshell.version}")
units = f.createIfcUnitAssignment(Units=[f.createIfcSIUnit(None, "LENGTHUNIT", None, "METRE")])
ownerhist = f.createIfcOwnerHistory(pando, appl, ChangeAction="ADDED", CreationDate=int(time.time()))
2024-07-26 12:00:28 +10:00
wall = f.createIfcWallStandardCase(ifcopenshell.guid.new(), ownerhist)
if i in (1, 2):
2023-01-11 12:48:53 +01:00
mls = f.createIfcMaterialLayerSet([f.createIfcMaterialLayer(None, 0.1)])
if i == 2:
2024-07-26 12:00:28 +10:00
mls = f.createIfcMaterialLayerSetUsage(mls, "AXIS2", "POSITIVE", 0.0)
2023-01-11 12:48:53 +01:00
f.createIfcRelAssociatesMaterial(
2024-07-26 12:00:28 +10:00
ifcopenshell.guid.new(), ownerhist, RelatedObjects=[wall], RelatingMaterial=mls
2023-01-11 12:48:53 +01:00
)
f.write(f"{'pass' if i == 2 else 'fail'}-wall-{nm}-ifc2x3.ifc")