Replace all ifcopenshell.api.run with ifcopenshell.api static functions.

This commit is contained in:
Dion Moult
2024-06-28 12:36:31 +10:00
parent b5d613989e
commit 07060fc769
432 changed files with 4633 additions and 4856 deletions
@@ -17,21 +17,22 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import test.bootstrap
import ifcopenshell.api
import ifcopenshell.api.root
import ifcopenshell.api.boundary
class TestCopyBoundary(test.bootstrap.IFC4):
def test_run(self):
boundary = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcRelSpaceBoundary")
boundary2 = ifcopenshell.api.run("boundary.copy_boundary", self.file, boundary=boundary)
boundary = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcRelSpaceBoundary")
boundary2 = ifcopenshell.api.boundary.copy_boundary(self.file, boundary=boundary)
assert boundary2.is_a("IfcRelSpaceBoundary")
assert boundary2.GlobalId != boundary.GlobalId
def test_copying_connection_geometry(self):
geometry = self.file.createIfcConnectionSurfaceGeometry()
boundary = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcRelSpaceBoundary")
boundary = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcRelSpaceBoundary")
boundary.ConnectionGeometry = geometry
boundary2 = ifcopenshell.api.run("boundary.copy_boundary", self.file, boundary=boundary)
boundary2 = ifcopenshell.api.boundary.copy_boundary(self.file, boundary=boundary)
assert boundary2.ConnectionGeometry.is_a("IfcConnectionSurfaceGeometry")
assert boundary2.ConnectionGeometry != boundary.ConnectionGeometry
@@ -17,20 +17,21 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import test.bootstrap
import ifcopenshell.api
import ifcopenshell.api.root
import ifcopenshell.api.boundary
class TestRemoveBoundary(test.bootstrap.IFC4):
def test_run(self):
boundary = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcRelSpaceBoundary")
ifcopenshell.api.run("boundary.remove_boundary", self.file, boundary=boundary)
boundary = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcRelSpaceBoundary")
ifcopenshell.api.boundary.remove_boundary(self.file, boundary=boundary)
assert not self.file.by_type("IfcRelSpaceBoundary")
def test_removing_connection_geometry(self):
geometry = self.file.createIfcConnectionSurfaceGeometry()
boundary = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcRelSpaceBoundary")
boundary = ifcopenshell.api.root.create_entity(self.file, ifc_class="IfcRelSpaceBoundary")
boundary.ConnectionGeometry = geometry
ifcopenshell.api.run("boundary.remove_boundary", self.file, boundary=boundary)
ifcopenshell.api.boundary.remove_boundary(self.file, boundary=boundary)
assert not self.file.by_type("IfcRelSpaceBoundary")
assert not self.file.by_type("IfcConnectionSurfaceGeometry")