mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
Fix uses of ifcopenshell.file
This commit is contained in:
@@ -24,7 +24,7 @@ import ifcopenshell.api.context
|
||||
import ifcopenshell.api.unit
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -32,7 +32,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_create():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="Test")
|
||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||
ifcopenshell.api.unit.assign_unit(file, units=[length])
|
||||
|
||||
@@ -26,7 +26,7 @@ import ifcopenshell.util
|
||||
import ifcopenshell.util.unit
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -34,7 +34,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_create_as_offset_curve():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="OCBD Test Alignment")
|
||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||
ifcopenshell.api.unit.assign_unit(file, units=[length])
|
||||
|
||||
@@ -23,7 +23,7 @@ import ifcopenshell.api.alignment
|
||||
import ifcopenshell.api.unit
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -31,7 +31,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_create_as_polyline():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="Test")
|
||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||
ifcopenshell.api.unit.assign_unit(file, units=[length])
|
||||
|
||||
@@ -25,14 +25,14 @@ import ifcopenshell.api.context
|
||||
import ifcopenshell.api.unit
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
|
||||
|
||||
def _test_horizontal() -> ifcopenshell.file:
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="Test")
|
||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||
ifcopenshell.api.unit.assign_unit(file, units=[length])
|
||||
@@ -131,7 +131,7 @@ def _test_horizontal() -> ifcopenshell.file:
|
||||
|
||||
|
||||
def _test_horizontal_vertical():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="Test")
|
||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||
ifcopenshell.api.unit.assign_unit(file, units=[length])
|
||||
|
||||
@@ -23,7 +23,7 @@ import ifcopenshell.api.alignment
|
||||
import ifcopenshell.api.unit
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -31,7 +31,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_create_no_geometry():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="Test")
|
||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||
ifcopenshell.api.unit.assign_unit(file, units=[length])
|
||||
|
||||
@@ -56,7 +56,7 @@ def test_create_representation():
|
||||
(12799.99998062693, 89.99999997234107, 0.9999875002340269, -0.004999937569813611),
|
||||
]
|
||||
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
file.header.file_description.description = ["ViewDefinition [Alignment-basedView]"]
|
||||
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="FHWA Alignment")
|
||||
|
||||
@@ -24,7 +24,7 @@ import ifcopenshell.api.context
|
||||
import ifcopenshell.api.unit
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -32,7 +32,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_get_alignment():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(GlobalId=ifcopenshell.guid.new(), Name="Test")
|
||||
length = ifcopenshell.api.unit.add_si_unit(file, unit_type="LENGTHUNIT")
|
||||
ifcopenshell.api.unit.assign_unit(file, units=[length])
|
||||
|
||||
@@ -23,7 +23,7 @@ import ifcopenshell.api.cogo
|
||||
import ifcopenshell.api.context
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -31,7 +31,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_add_survey_point():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(Name="Test")
|
||||
site = file.createIfcSite(GlobalId=ifcopenshell.guid.new(), Name="MySite")
|
||||
ifcopenshell.api.aggregate.assign_object(file, relating_object=project, products=[site])
|
||||
|
||||
@@ -23,7 +23,7 @@ import ifcopenshell.api.cogo
|
||||
import ifcopenshell.api.context
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -31,7 +31,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_assign_survey_point():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(Name="Test")
|
||||
site = file.createIfcSite(GlobalId=ifcopenshell.guid.new(), Name="MySite")
|
||||
ifcopenshell.api.aggregate.assign_object(file, relating_object=project, products=[site])
|
||||
|
||||
@@ -23,7 +23,7 @@ import ifcopenshell.api.cogo
|
||||
import ifcopenshell.api.context
|
||||
|
||||
try:
|
||||
ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
ifcopenshell.file(schema="IFC4X3")
|
||||
IFC4X3_AVAILABLE = True
|
||||
except RuntimeError:
|
||||
IFC4X3_AVAILABLE = False
|
||||
@@ -31,7 +31,7 @@ except RuntimeError:
|
||||
|
||||
@pytest.mark.skipif(not IFC4X3_AVAILABLE, reason="IFC4X3 not available")
|
||||
def test_edit_survey_point():
|
||||
file = ifcopenshell.file(schema="IFC4X3_ADD2")
|
||||
file = ifcopenshell.file(schema="IFC4X3")
|
||||
project = file.createIfcProject(Name="Test")
|
||||
site = file.createIfcSite(GlobalId=ifcopenshell.guid.new(), Name="MySite")
|
||||
ifcopenshell.api.aggregate.assign_object(file, relating_object=project, products=[site])
|
||||
|
||||
Reference in New Issue
Block a user