mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 19:30:25 +00:00
23 lines
660 B
Python
23 lines
660 B
Python
import ifcopenshell
|
|
|
|
from ...fixture_generate import normalize_header, pass_if, write_fixture
|
|
|
|
dims = [
|
|
(1, 0, 0, 0, 0, 0, 0),
|
|
(1, 1, 0, 0, 0, 0, 0),
|
|
(0, 1, 0, 0, 0, 0, 0),
|
|
(-1, 0, 0, 0, 0, 0, 0),
|
|
(2, 0, 0, 0, 0, 0, 0),
|
|
]
|
|
|
|
for i, d in enumerate(dims):
|
|
f = ifcopenshell.file(schema="IFC2X3")
|
|
f.createIfcConversionBasedUnit(
|
|
f.createIfcDimensionalExponents(*d),
|
|
"LENGTHUNIT",
|
|
"beard-second",
|
|
f.createIfcMeasureWithUnit(f.createIfcLengthMeasure(5.0), f.createIfcSIUnit(Prefix="NANO", Name="METRE")),
|
|
)
|
|
normalize_header(f)
|
|
write_fixture(f, __file__, pass_if(i == 0), f"conv-unit-{i}-ifc2x3")
|