mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Write documentation for sequence API module
This commit is contained in:
@@ -20,11 +20,35 @@ import ifcopenshell.util.date
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
def __init__(self, file, work_time=None, attributes=None):
|
||||
"""Edits the attributes of an IfcWorkTime
|
||||
|
||||
For more information about the attributes and data types of an
|
||||
IfcWorkTime, consult the IFC documentation.
|
||||
|
||||
:param work_time: The IfcWorkTime entity you want to edit
|
||||
:type work_time: ifcopenshell.entity_instance.entity_instance
|
||||
:param attributes: a dictionary of attribute names and values.
|
||||
:type attributes: dict, optional
|
||||
:return: None
|
||||
:rtype: None
|
||||
|
||||
Example::
|
||||
|
||||
# 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")
|
||||
|
||||
# Edit our work time to state that the work time only applies after
|
||||
# a start date.
|
||||
ifcopenshell.api.run("sequence.edit_work_time", model,
|
||||
work_time=work_time, attributes={"StartDate": "2000-01-01"})
|
||||
"""
|
||||
self.file = file
|
||||
self.settings = {"work_time": None, "attributes": {}}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
self.settings = {"work_time": work_time, "attributes": attributes or {}}
|
||||
|
||||
def execute(self):
|
||||
for name, value in self.settings["attributes"].items():
|
||||
|
||||
Reference in New Issue
Block a user