2022-12-26 11:29:32 +01:00
|
|
|
import itertools
|
|
|
|
|
import time
|
2025-12-19 18:53:04 +05:00
|
|
|
|
2022-12-26 11:29:32 +01:00
|
|
|
import ifcopenshell
|
|
|
|
|
|
2024-07-26 12:00:28 +10:00
|
|
|
for pty, ety in itertools.product(("GRILLE", "USERDEFINED"), (None, "Something")):
|
2022-12-26 11:29:32 +01:00
|
|
|
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}")
|
|
|
|
|
ownerhist = f.createIfcOwnerHistory(pando, appl, ChangeAction="ADDED", CreationDate=int(time.time()))
|
2024-07-26 12:00:28 +10:00
|
|
|
f.createIfcAirTerminalType(ifcopenshell.guid.new(), ownerhist, "My Type", ElementType=ety, PredefinedType=pty)
|
|
|
|
|
valid = pty != "USERDEFINED" or ety is not None
|
2022-12-26 11:29:32 +01:00
|
|
|
f.write(f"{'pass' if valid else 'fail'}-air-terminal-type-{pty}-{ety}-ifc2x3.ifc")
|