Write docs for system API module

This commit is contained in:
Dion Moult
2023-01-04 16:09:26 +11:00
parent b86818ead3
commit 92623b98e2
10 changed files with 322 additions and 47 deletions
@@ -49,14 +49,35 @@ def is_assignable(product, system) -> bool:
class Usecase:
def __init__(self, file, **settings):
def __init__(self, file, product=None, system=None):
"""Assigns a distribution element to a system
Note that it is not necessary to assign distribution ports to a system.
:param product: The IfcDistributionElement to assign to the system.
:type product: ifcopenshell.entity_instance.entity_instance
:param system: The IfcSystem you want to assign the element to.
:type system: ifcopenshell.entity_instance.entity_instance
:return: The IfcRelAssignsToGroup relationship
:rtype: ifcopenshell.entity_instance.entity_instance
Example::
# A completely empty distribution system
system = ifcopenshell.api.run("system.add_system", model)
# Create a duct
duct = ifcopenshell.api.run("root.create_entity", model,
ifc_class="IfcDuctSegment", predefined_type="RIGIDSEGMENT")
# This duct is part of the system
ifcopenshell.api.run("system.assign_system", model, product=duct, system=system)
"""
self.file = file
self.settings = {
"product": None,
"system": None,
"product": product,
"system": system,
}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
system = self.settings["system"]