mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Write docs for system API module
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user