Files
IfcOpenShell/src/ifcopenshell-python/test/fixtures/validate/generate_00.py
T

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

28 lines
1.0 KiB
Python
Raw Normal View History

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
from ...fixture_generate import normalize_header, pass_if, write_fixture
guid1 = "3pdqyORIn8KBHZAhhtJ72T"
guid2 = "1sEzC8v31DshmvW5t5P631"
for schema in ("IFC2X3", "IFC4", "IFC4X3"):
for status in ("fail", "pass"):
f = ifcopenshell.file(schema=schema)
# setup IfcOwnerHistory
if schema == "IFC2X3":
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)
wall1 = ifcopenshell.api.root.create_entity(f)
wall2 = ifcopenshell.api.root.create_entity(f)
wall1.GlobalId = guid1
wall2.GlobalId = guid1 if status == "fail" else guid2
normalize_header(f)
write_fixture(f, __file__, pass_if(status == "pass"), f"duplicated-guids-{schema.lower()}")