2025-12-19 18:53:04 +05:00
|
|
|
import ifcopenshell
|
|
|
|
|
import ifcopenshell.api.owner
|
|
|
|
|
import ifcopenshell.api.root
|
2026-08-10 15:31:39 +05:00
|
|
|
|
2026-08-03 19:46:18 +05:00
|
|
|
from ...fixture_generate import normalize_header, pass_if, write_fixture
|
2024-04-02 17:17:23 +05:00
|
|
|
|
|
|
|
|
guid1 = "3pdqyORIn8KBHZAhhtJ72T"
|
|
|
|
|
guid2 = "1sEzC8v31DshmvW5t5P631"
|
|
|
|
|
|
2026-08-03 15:16:27 +05:00
|
|
|
for schema in ("IFC2X3", "IFC4", "IFC4X3"):
|
2024-04-02 17:17:23 +05:00
|
|
|
for status in ("fail", "pass"):
|
|
|
|
|
f = ifcopenshell.file(schema=schema)
|
|
|
|
|
|
|
|
|
|
# setup IfcOwnerHistory
|
2026-08-03 15:16:27 +05:00
|
|
|
if schema == "IFC2X3":
|
2024-06-28 12:36:31 +10:00
|
|
|
ifcopenshell.api.owner.add_application(f)
|
|
|
|
|
person = ifcopenshell.api.owner.add_person(f)
|
|
|
|
|
organization = ifcopenshell.api.owner.add_organisation(f)
|
|
|
|
|
ifcopenshell.api.owner.add_person_and_organisation(f, person=person, organisation=organization)
|
2024-04-02 17:17:23 +05:00
|
|
|
|
2024-06-28 12:36:31 +10:00
|
|
|
wall1 = ifcopenshell.api.root.create_entity(f)
|
|
|
|
|
wall2 = ifcopenshell.api.root.create_entity(f)
|
2024-04-02 17:17:23 +05:00
|
|
|
wall1.GlobalId = guid1
|
|
|
|
|
wall2.GlobalId = guid1 if status == "fail" else guid2
|
|
|
|
|
|
2026-08-03 19:46:18 +05:00
|
|
|
normalize_header(f)
|
|
|
|
|
write_fixture(f, __file__, pass_if(status == "pass"), f"duplicated-guids-{schema.lower()}")
|