mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Generate functions for all API usecases for better static code features. See #2693.
This commit is contained in:
@@ -17,31 +17,28 @@
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, work_time=None):
|
||||
"""Removes a work time
|
||||
def remove_work_time(file, work_time=None) -> None:
|
||||
"""Removes a work time
|
||||
|
||||
:param work_time: The IfcWorkTime to remove.
|
||||
:type work_time: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
:param work_time: The IfcWorkTime to remove.
|
||||
:type work_time: ifcopenshell.entity_instance
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example:
|
||||
Example:
|
||||
|
||||
.. code:: python
|
||||
.. code:: python
|
||||
|
||||
# Let's create a new calendar.
|
||||
calendar = ifcopenshell.api.run("sequence.add_work_calendar", model)
|
||||
# Let's create a new calendar.
|
||||
calendar = ifcopenshell.api.run("sequence.add_work_calendar", model)
|
||||
|
||||
# Let's start defining the times that we work during the week.
|
||||
work_time = ifcopenshell.api.run("sequence.add_work_time", model,
|
||||
work_calendar=calendar, time_type="WorkingTimes")
|
||||
# Let's start defining the times that we work during the week.
|
||||
work_time = ifcopenshell.api.run("sequence.add_work_time", model,
|
||||
work_calendar=calendar, time_type="WorkingTimes")
|
||||
|
||||
# And remove it immediately
|
||||
ifcopenshell.api.run("sequence.remove_work_time", model, work_time=work_time)
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"work_time": work_time}
|
||||
# And remove it immediately
|
||||
ifcopenshell.api.run("sequence.remove_work_time", model, work_time=work_time)
|
||||
"""
|
||||
settings = {"work_time": work_time}
|
||||
|
||||
def execute(self):
|
||||
self.file.remove(self.settings["work_time"])
|
||||
file.remove(settings["work_time"])
|
||||
|
||||
Reference in New Issue
Block a user