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
@@ -47,7 +47,7 @@ def add_arbitrary_profile(
# A 10mm by 100mm rectangle, such that might be used as a wooden
# skirting board or kick plate.
square = ifcopenshell.api.run("profile.add_arbitrary_profile", model,
square = ifcopenshell.api.profile.add_arbitrary_profile(model,
profile=[(0., 0.), (.01, 0.), (.01, .1), (0., .1), (0., 0.)],
name="SK01 Profile")
"""
@@ -56,7 +56,7 @@ def add_arbitrary_profile_with_voids(
.. code:: python
# A 400mm by 400mm square with a 200mm by 200mm hole in it.
square_with_hole = ifcopenshell.api.run("profile.add_arbitrary_profile_with_voids", model,
square_with_hole = ifcopenshell.api.profile.add_arbitrary_profile_with_voids(model,
outer_profile=[(0., 0.), (.4, 0.), (.4, .4), (0., .4), (0., 0.)],
inner_profiles=[[(0.1, 0.1), (0.3, 0.1), (0.3, 0.3), (0.1, 0.3), (0.1, 0.1)]],
name="SK01 Hole Profile")
@@ -38,7 +38,7 @@ def add_parameterized_profile(file: ifcopenshell.file, ifc_class: str) -> ifcope
.. code:: python
circle = ifcopenshell.api.run("profile.add_parameterized_profile", model,
circle = ifcopenshell.api.profile.add_parameterized_profile(model,
ifc_class="IfcCircleProfileDef")
circle.Radius = 1.
"""
@@ -36,11 +36,11 @@ def edit_profile(file: ifcopenshell.file, profile: ifcopenshell.entity_instance,
.. code:: python
circle = ifcopenshell.api.run("profile.add_parameterized_profile", model,
circle = ifcopenshell.api.profile.add_parameterized_profile(model,
ifc_class="IfcCircleProfileDef")
circle = 1.
ifcopenshell.api.run("profile.edit_profile", model,
ifcopenshell.api.profile.edit_profile(model,
profile=circle, attributes={"ProfileName": "1000mm Dia"})
"""
settings = {"profile": profile, "attributes": attributes}
@@ -32,10 +32,10 @@ def remove_profile(file: ifcopenshell.file, profile: ifcopenshell.entity_instanc
.. code:: python
circle = ifcopenshell.api.run("profile.add_parameterized_profile", model,
circle = ifcopenshell.api.profile.add_parameterized_profile(model,
ifc_class="IfcCircleProfileDef")
circle = 1.
ifcopenshell.api.run("profile.remove_profile", model, profile=circle)
ifcopenshell.api.profile.remove_profile(model, profile=circle)
"""
settings = {"profile": profile}